/* Custom styles */
.nav-link.active {
    border-color: #4f46e5;
    color: #4f46e5;
}

.nav-link-mobile.active {
    background-color: #eef2ff;
    color: #4f46e5;
}

/* Стили для таблиц */
table {
    border-collapse: collapse;
    width: 100%;
}

table thead {
    background-color: #f9fafb;
}

table th {
    padding: 12px 24px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table td {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #111827;
}

table tbody tr:hover {
    background-color: #f9fafb;
}

/* Стили для кнопок в таблицах */
.btn-edit {
    color: #4f46e5;
    text-decoration: none;
    font-size: 0.875rem;
    margin-right: 12px;
}

.btn-edit:hover {
    color: #4338ca;
    text-decoration: underline;
}

.btn-delete {
    color: #dc2626;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-delete:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* Стили для модальных окон */
.modal {
    display: none;
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 85vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-close {
    color: #9ca3af;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    color: #374151;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background-color: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.notification.error {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

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

/* Loader */
.loader {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive форм */
@media (max-width: 768px) {
    table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    table th,
    table td {
        padding: 8px 12px;
        white-space: nowrap;
    }
    
    table th {
        font-size: 0.7rem;
        padding: 8px 8px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 20px;
        max-height: 95vh;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
}

/* Улучшение input полей для модальных окон и форм */
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content input[type="datetime-local"],
.modal-content input[type="password"],
.modal-content select,
.modal-content textarea,
form:not(#loginForm) input[type="text"],
form:not(#loginForm) input[type="number"],
form:not(#loginForm) input[type="datetime-local"],
form:not(#loginForm) input[type="password"],
form:not(#loginForm) select,
form:not(#loginForm) textarea {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    width: 100%;
    font-size: 0.875rem;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="number"]:focus,
.modal-content input[type="datetime-local"]:focus,
.modal-content input[type="password"]:focus,
.modal-content select:focus,
.modal-content textarea:focus,
form:not(#loginForm) input[type="text"]:focus,
form:not(#loginForm) input[type="number"]:focus,
form:not(#loginForm) input[type="datetime-local"]:focus,
form:not(#loginForm) input[type="password"]:focus,
form:not(#loginForm) select:focus,
form:not(#loginForm) textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Кнопка как ссылка */
.btn-edit {
    cursor: pointer;
}
