/* public/css/style.css — Общие стили для всех страниц */

/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    min-height: 100vh;
    background: #f5f7fa;
    padding: 20px;
    color: #2d3748;
    font-size: 15px;
    line-height: 1.5;
}

/* ===== КОНТЕЙНЕРЫ ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== КНОПКИ ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

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

.btn-danger:hover {
    background: #f56565;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(252, 129, 129, 0.3);
}

.btn-back {
    background: #a0aec0;
    color: white;
}

.btn-back:hover {
    background: #718096;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* ===== СТАТУСЫ ===== */
.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

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

.status-assigned {
    background: #bee3f8;
    color: #2a4365;
}

.status-maintenance {
    background: #fefcbf;
    color: #744210;
}

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

/* ===== TOAST УВЕДОМЛЕНИЯ ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    animation: slideIn 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 500px;
    font-size: 14px;
    font-weight: 500;
}

.toast-success {
    background: #48bb78;
}

.toast-error {
    background: #fc8181;
}

.toast-info {
    background: #63b3ed;
}

.toast-warning {
    background: #ed8936;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal h3 {
    color: #333;
    margin-bottom: 15px;
}

.modal p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

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

/* ===== ФОРМЫ ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #4a5568;
    font-weight: 500;
    font-size: 14px;
}

.form-group label .required {
    color: #fc8181;
    margin-left: 3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
    background: white;
    color: #2d3748;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #cbd5e0;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* ===== ХЕДЕР ===== */
.header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

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

.header .subtitle {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ===== ПУСТЫЕ СОСТОЯНИЯ ===== */
.empty-state {
    padding: 60px;
    text-align: center;
    color: #999;
}

.empty-state .emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 18px;
}

.empty-state p {
    color: #a0aec0;
    font-size: 14px;
}

/* ===== ТАБЛИЦЫ (общие) ===== */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

/* ===== ССЫЛКИ ===== */
a {
    color: #667eea;
    transition: color 0.2s;
}

a:hover {
    color: #5a67d8;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 14px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal {
        padding: 20px;
    }
    
    .toast {
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* ===== СПЕЦИАЛЬНЫЕ ЭЛЕМЕНТЫ ===== */

/* Скрыть скроллбар для красоты */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f7fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Убираем выделение текста при нажатии на кнопки */
.btn,
.btn-icon,
button {
    user-select: none;
    -webkit-user-select: none;
}

/* Плавные переходы для всех элементов */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}