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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    color: #333;
    font-size: 28px;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.last-update {
    color: #666;
    font-size: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
}

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

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
}

.vms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.vm-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.vm-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.vm-card.empty {
    border: 2px dashed #ccc;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.vm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.vm-title h3 {
    color: #333;
    margin-bottom: 5px;
}

.vm-title p {
    color: #666;
    font-size: 12px;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-success {
    background: #c6f6d5;
    color: #22543d;
}

.status-unreachable {
    background: #fed7d7;
    color: #742a2a;
}

.status-error {
    background: #feebc8;
    color: #7c2d12;
}

.status-unknown {
    background: #e2e8f0;
    color: #2d3748;
}

.vm-info {
    margin: 15px 0;
}

.info-row {
    margin: 8px 0;
    font-size: 14px;
}

.info-row strong {
    color: #4a5568;
    display: inline-block;
    width: 80px;
}

.logs-section {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.logs-title {
    font-size: 13px;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 8px;
}

.logs-list {
    max-height: 150px;
    overflow-y: auto;
}

.log-item {
    background: #f7fafc;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 12px;
    font-family: monospace;
    color: #2d3748;
}

.no-logs {
    color: #a0aec0;
    font-style: italic;
    font-size: 12px;
}

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

.card-actions button {
    padding: 5px 10px;
    font-size: 12px;
}

.add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-card .plus-icon {
    font-size: 48px;
    color: #a0aec0;
}

.add-card p {
    color: #718096;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .vms-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
}
