:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-primary: #58a6ff;
    --accent-hover: #1f6feb;
    --success: #3fb950;
    --success-hover: #2ea043;
    --error: #f85149;
    --error-hover: #da3633;
    --warning: #d29922;
    --status-running: #3fb950;
    --status-stopped: #8b949e;
    --status-starting: #d29922;
    --status-stopping: #d29922;
    --status-unknown: #6e7681;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

.logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--accent-primary);
}

.logo svg {
    width: 100%;
    height: 100%;
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    width: 100%;
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: var(--error-hover);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .btn-loader {
    display: inline-block;
}

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

.error-message {
    margin-top: 15px;
    padding: 10px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--error);
    border-radius: 6px;
    color: var(--error);
    font-size: 13px;
    display: none;
}

.error-message.active {
    display: block;
}

/* Dashboard */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.nav-brand svg {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
}

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

.welcome-message {
    text-align: center;
    margin-bottom: 60px;
    transition: border-color 0.2s;
}

.card-featured {
    border-color: var(--accent-primary);
}

.welcome-message h2 {
    font-size: 32px;
    margin-bottom: 12px;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-body p {
    color: var(--text-secondary);
    font-size: 14px;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-tertiary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-running .status-dot {
    background: var(--status-running);
}

.status-stopped .status-dot {
    background: var(--status-stopped);
    animation: none;
}

.status-starting .status-dot,
.status-stopping .status-dot {
    background: var(--status-starting);
}

.status-unknown .status-dot {
    background: var(--status-unknown);
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* VM Info */
.vm-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.info-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.info-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
}

.button-group .btn {
    flex: 1;
}

.badge-info {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 16px;
    }
    
    .container {
        padding: 24px 16px;
    }
    
    .welcome-message h2 {
        font-size: 24px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}
