* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-form h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.tagline {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Header */
header {
    background: #2c3e50;
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover, .nav-link.active {
    background: #34495e;
}

/* Main Content */
main {
    min-height: 60vh;
}

.section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #2ecc71;
}

.btn-primary:hover {
    background: #27ae60;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

.actions {
    white-space: nowrap;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Current Directory */
.current-dir {
    background: #ecf0f1;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: between;
    align-items: center;
}

/* Role Badges */
.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-admin {
    background: #e74c3c;
    color: white;
}

.role-user {
    background: #3498db;
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

/* Info Box */
.info-box {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-box h3 {
    color: #0c5460;
    margin-bottom: 1rem;
}

.info-box code {
    background: #1a1a1a;
    color: #00ff00;
    padding: 0.5rem;
    border-radius: 3px;
    display: block;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

/* Register Link */
.register-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.register-link a {
    color: #3498db;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    nav {
        flex-direction: column;
    }
    
    .nav-link {
        text-align: center;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* Backup file styles */
.no-backups {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 2rem 0;
}

.no-backups h3 {
    color: #6c757d;
    margin-bottom: 1rem;
}

.no-backups ul {
    text-align: left;
    display: inline-block;
    margin: 1rem 0;
}

.no-backups li {
    margin: 0.5rem 0;
}

.backup-actions {
    margin-top: 2rem;
}

.backup-actions .btn {
    margin: 0 0.5rem;
}

.file-type {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.file-type.dir {
    background: #3498db;
    color: white;
}

.file-type.file {
    background: #2ecc71;
    color: white;
}

/* Backup file table improvements */
.files-table td {
    vertical-align: middle;
}

.files-table .actions {
    white-space: nowrap;
}
/* Status Summary Cards */
.status-summary {
    margin-bottom: 2rem;
}

.summary-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-card {
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-card.online {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.summary-card.offline {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.summary-card.total {
    background-color: #e2e3e5;
    border: 1px solid #d6d8db;
}

.summary-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

.summary-card .count {
    font-size: 2rem;
    font-weight: bold;
}

.summary-card.online .count {
    color: #155724;
}

.summary-card.offline .count {
    color: #721c24;
}

.summary-card.total .count {
    color: #383d41;
}

/* Router Status */
.router-status {
    display: flex;
    align-items: center;
    font-weight: bold;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: #28a745;
}

.status-offline {
    background-color: #dc3545;
}

.last-backup {
    font-size: 0.85em;
    color: #666;
}

.no-backup {
    color: #999;
    font-style: italic;
}

/* Button states */
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 1px solid #007bff;
    color: #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}