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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --danger: #d32f2f;
    --success: #4caf50;
    --warning: #ff9800;
}

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    transition: background 0.3s ease;
    color: #333;
}

/* THEMES */
body.theme-dark {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}
body.theme-neon {
    background: linear-gradient(135deg, #000000 0%, #1a0a3e 50%, #16213e 100%);
}
body.theme-sunset {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #ee5a6f 100%);
}
body.theme-forest {
    background: linear-gradient(135deg, #134e5e 0%, #71b280 50%, #089fdf 100%);
}
body.theme-ocean {
    background: linear-gradient(135deg, #001a4d 0%, #0d47a1 50%, #0277bd 100%);
}

/* LOGIN PAGE */
.login-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.5s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 40px;
}
.login-logo { font-size: 48px; margin-bottom: 15px; }
.login-header h1 { font-size: 28px; color: var(--primary); margin-bottom: 5px; }
.login-header p  { color: #999; font-size: 14px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}
.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 12px;
    font-size: 14px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}
.btn-secondary:hover { background: #ebebeb; }

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    display: none;
}
.message.error   { background: #ffebee; color: #c62828; border: 1px solid #ef5350; }
.message.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #66bb6a; }

.toggle-text { text-align: center; margin-top: 20px; color: #999; font-size: 13px; }
.toggle-text a { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 600; }

/* MAIN APP */
.app-page { display: none; min-height: 100vh; color: white; }
.app-page.active { display: block; }

/* SIDEBAR */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    padding: 30px 20px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-logo  { font-size: 32px; margin-bottom: 10px; }
.sidebar-title { font-size: 16px; font-weight: bold; margin-bottom: 30px; }

.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 15px; }
.sidebar-menu a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s;
}
.sidebar-menu a:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.sidebar-menu a.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* MAIN CONTENT */
.main-content { margin-left: 280px; padding: 30px; min-height: 100vh; }

/* TOP BAR */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.top-bar-title { font-size: 24px; font-weight: bold; }
.top-bar-controls { display: flex; gap: 15px; align-items: center; }

.btn-small { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.3s; font-size: 13px; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(76,175,80,0.4); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255,152,0,0.4); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(211,47,47,0.4); }

.select-theme {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
}
.select-theme option { background: #333; color: white; }

.btn-logout {
    background: var(--danger);
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-logout:hover { background: #b71c1c; }

/* CARD */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    color: #333;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}
.card h2 { font-size: 18px; margin-bottom: 20px; color: var(--primary); display: flex; align-items: center; gap: 10px; }

/* INSTANCES */
.instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}
.instance-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}
.instance-card:hover { background: rgba(0,0,0,0.4); border-color: var(--primary); }
.instance-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 15px; }
.instance-name   { font-size: 18px; font-weight: bold; color: white; }
.instance-status { padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.instance-status.offline { background: rgba(211,47,47,0.2); color: #ef5350; }
.instance-status.online  { background: rgba(76,175,80,0.2);  color: #66bb6a; }
.instance-info   { margin-bottom: 15px; font-size: 13px; color: rgba(255,255,255,0.7); }
.instance-actions { display: flex; gap: 10px; }
.instance-actions button {
    flex: 1; padding: 8px; border: none; border-radius: 6px;
    color: white; cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.3s;
}
.btn-start   { background: var(--success); }
.btn-start:hover { background: #45a049; }
.btn-restart { background: var(--warning); }
.btn-restart:hover { background: #f57c00; }
.btn-stop    { background: var(--danger); }
.btn-stop:hover { background: #b71c1c; }

/* CONSOLE */
.console-container { background: #1e1e1e; border-radius: 12px; padding: 20px; font-family: 'Courier New', monospace; margin-bottom: 25px; }
.console-title { color: #00ff00; margin-bottom: 15px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.console-output { background: #0a0a0a; border-radius: 8px; padding: 15px; height: 350px; overflow-y: auto; margin-bottom: 15px; }
.console-line         { color: #00ff00; font-size: 12px; margin-bottom: 8px; word-break: break-all; }
.console-line.error   { color: #ff6b6b; }
.console-line.warning { color: #ffd700; }
.console-line.success { color: #66bb6a; }
.console-line.info    { color: #64b5f6; }
.console-input-group  { display: flex; gap: 10px; }
.console-input {
    flex: 1; background: #2d2d2d; border: 1px solid #444;
    color: #00ff00; padding: 10px; border-radius: 6px;
    font-family: 'Courier New', monospace; font-size: 13px;
}
.console-input:focus { outline: none; border-color: #00ff00; }

/* FILE MANAGER */
.file-list { background: rgba(0,0,0,0.3); border-radius: 12px; padding: 15px; margin-bottom: 25px; }
.file-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px; background: rgba(255,255,255,0.05);
    border-radius: 8px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1);
}
.file-name    { color: white; font-weight: 500; }
.file-actions { display: flex; gap: 8px; }
.btn-file     { padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 600; color: white; transition: all 0.3s; }
.btn-download { background: #2196F3; }
.btn-download:hover { background: #1976D2; }
.btn-delete-file { background: var(--danger); }
.btn-delete-file:hover { background: #b71c1c; }

/* UPLOAD AREA */
.upload-area {
    border: 2px dashed rgba(255,255,255,0.3); border-radius: 12px;
    padding: 40px; text-align: center; cursor: pointer;
    transition: all 0.3s; background: rgba(0,0,0,0.2); margin-bottom: 25px;
}
.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(102,126,234,0.1);
}
.upload-area.drag-over { background: rgba(102,126,234,0.2); }
.upload-icon  { font-size: 48px; margin-bottom: 15px; }
.upload-text  { color: white; margin-bottom: 5px; }
.upload-small { color: rgba(255,255,255,0.6); font-size: 12px; }
#fileInput    { display: none; }

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}
.stat-box { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 20px; text-align: center; }
.stat-label { color: rgba(255,255,255,0.6); font-size: 12px; margin-bottom: 10px; }
.stat-value { font-size: 32px; font-weight: bold; color: var(--primary); }

/* SECTION VISIBILITY */
.hidden  { display: none !important; }
.section { display: none; }
.section.active { display: block; }

input[type="text"].server-name-input {
    background: rgba(255,255,255,0.9);
    border: 2px solid var(--primary);
    color: #333; padding: 10px 15px; border-radius: 8px; font-weight: 600;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.5); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { width: 70px; padding: 20px 10px; }
    .main-content { margin-left: 70px; padding: 20px; }
    .sidebar-title { font-size: 0; }
    .sidebar-menu a span { display: none; }
    .instances-grid { grid-template-columns: 1fr; }
    .console-output { height: 250px; }
    .top-bar { flex-direction: column; gap: 15px; align-items: flex-start; }
    .top-bar-controls { flex-wrap: wrap; }
}
