/* Добавьте эти стили к существующим */

/* Форма добавления */
.add-form {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.add-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.add-form label {
    font-size: 14px;
    margin-bottom: 5px;
    display: block;
}

.add-form input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

/* Поиск */
.search-container {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
}

.search-container input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-clear {
    background: #a0aec0;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-clear:hover {
    background: #718096;
}

/* Таблица */
.computers-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.computers-table th,
.computers-table td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: left;
}

.computers-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.computers-table tr:hover {
    background-color: #f7fafc;
}

/* Поле пароля */
.password-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-mask,
.password-value {
    font-family: monospace;
    font-size: 14px;
}

.btn-show-password {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
}

/* Кнопки действий */
.actions {
    white-space: nowrap;
}

.btn-history {
    background: #4299e1;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 12px;
}

.btn-edit {
    background: #48bb78;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 12px;
}

.btn-delete {
    background: #f56565;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-history:hover { background: #3182ce; }
.btn-edit:hover { background: #38a169; }
.btn-delete:hover { background: #e53e3e; }

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #a0aec0;
}

.close:hover {
    color: #4a5568;
}

/* История */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
    margin-bottom: 8px;
    border-radius: 6px;
}

.history-item strong {
    color: #2d3748;
}

.history-item small {
    color: #718096;
    display: block;
    margin-top: 5px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .add-form {
        flex-direction: column;
    }
    
    .add-form .form-group {
        width: 100%;
    }
    
    .computers-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }
    
    .computers-table th,
    .computers-table td {
        padding: 8px;
    }
    
    .btn-history,
    .btn-edit,
    .btn-delete {
        padding: 3px 6px;
        font-size: 10px;
        margin-right: 3px;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .actions {
        white-space: normal;
    }
    
    .btn-history,
    .btn-edit,
    .btn-delete {
        display: inline-block;
        margin-bottom: 3px;
    }
}

/* Анимация загрузки */
.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}