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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-900);
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
}

.auth-card h1 {
    font-size: 32px;
    margin-bottom: 8px;
    text-align: center;
    color: var(--gray-900);
}

.subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 32px;
}

.auth-form h2 {
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--gray-800);
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-form button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-form button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.auth-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error {
    background: #fee;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Main Container */
.main-container {
    min-height: 100vh;
    background: var(--gray-50);
}

header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    color: var(--gray-900);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info span {
    color: var(--gray-600);
    font-weight: 500;
}

/* Tabs */
.tabs {
    background: white;
    padding: 0 40px;
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--gray-200);
}

.tabs button {
    padding: 16px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tabs button:hover {
    color: var(--gray-900);
}

.tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Main Content */
main {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-content {
    animation: fadeIn 0.3s;
}

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

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

.section-header h2 {
    font-size: 24px;
    color: var(--gray-900);
}

/* Buttons */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

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

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Server Grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.server-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

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

.server-header h3 {
    font-size: 20px;
    color: var(--gray-900);
}

.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running {
    background: #d1fae5;
    color: #065f46;
}

.status-stopped {
    background: var(--gray-200);
    color: var(--gray-700);
}

.status-starting {
    background: #fef3c7;
    color: #92400e;
}

.server-details {
    margin-bottom: 16px;
}

.server-details p {
    margin-bottom: 8px;
    color: var(--gray-600);
    font-size: 14px;
}

.server-details strong {
    color: var(--gray-900);
}

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

.server-actions button {
    flex: 1;
    padding: 8px;
    font-size: 13px;
}

/* Template List */
.template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.template-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.template-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--gray-900);
}

.template-card p {
    margin-bottom: 8px;
    color: var(--gray-600);
    font-size: 14px;
}

.template-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--gray-900);
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.modal-content textarea {
    min-height: 80px;
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
}

.modal-content .checkbox-row input {
    width: auto;
    margin: 0;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    flex: 1;
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.empty-state p {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    main {
        padding: 20px;
    }
    
    .tabs {
        padding: 0 20px;
    }
    
    .server-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}
