* {
    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;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

header h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    gap: 15px;
}

.add-task-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#taskTitle, #taskDescription {
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#taskTitle:focus, #taskDescription:focus {
    outline: none;
    border-color: #667eea;
}

#taskDescription {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    flex: 1;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.column {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.column h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tasks {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 400px;
}

.task-card {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 10px;
    padding: 20px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.task-card.priority-high {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.task-card.priority-medium {
    border-left-color: #ffc107;
    background: #fffbf0;
}

.task-card.priority-low {
    border-left-color: #28a745;
    background: #f8fff9;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-title {
    font-weight: 600;
    color: #333;
    flex: 1;
    margin-right: 10px;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-actions button {
    padding: 6px 10px;
    font-size: 12px;
    background: #6c757d;
}

.task-actions button:hover {
    background: #5a6268;
}

.task-description {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
}

.priority-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high .priority-badge {
    background: #dc3545;
    color: white;
}

.priority-medium .priority-badge {
    background: #ffc107;
    color: #212529;
}

.priority-low .priority-badge {
    background: #28a745;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #333;
}

.modal h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal input, .modal textarea, .modal select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cancel {
    background: #6c757d;
}

.cancel:hover {
    background: #5a6268;
}

/* Drag and Drop */
.task-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.column.drag-over {
    background: #f0f8ff;
    border: 2px dashed #667eea;
}

@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    select, button {
        width: 100%;
    }
}

/* Стили для логина */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.login-btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
    padding: 12px;
    background: #ffe6e6;
    border-radius: 8px;
    border: 1px solid #dc3545;
    font-weight: 500;
    transition: all 0.3s ease;
}

.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-info {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    border-left: 4px solid #667eea;
}

.login-info p {
    margin: 5px 0;
}

.login-info strong {
    color: #333;
}

/* Стили для хедера с пользователем */
.user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #333;
}

.user-role {
    font-size: 12px;
    color: #666;
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn:hover {
    background: #c82333;
}

.profile-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-btn:hover {
    background: #5a6268;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 20px;
    text-align: center;
}

.add-task-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    padding: 15px 30px;
    font-size: 16px;
}

.add-task-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Large Modal */
.large-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Profile Styles */
.profile-info {
    margin-bottom: 20px;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e1e5e9;
}

.profile-field label {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.profile-field span {
    color: #666;
}

.change-password-section {
    border-top: 1px solid #e1e5e9;
    padding-top: 20px;
}

.change-password-section h4 {
    margin-bottom: 15px;
    color: #333;
}

.change-password-section input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
}

/* Notes in task cards */
.task-notes-preview {
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
}

.note-preview {
    background: rgba(102, 126, 234, 0.1);
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 5px;
    font-size: 12px;
    border-left: 2px solid #667eea;
}

.note-preview-author {
    font-weight: 600;
    color: #667eea;
    font-size: 11px;
}

.note-preview-content {
    color: #333;
    margin-top: 2px;
}

.note-preview-more {
    font-size: 11px;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* User list with delete buttons */
.user-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 8px;
}

.user-list-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-user-btn {
    background: #dc3545;
    padding: 5px 10px;
    font-size: 12px;
}

.delete-user-btn:hover {
    background: #c82333;
}

/* Checkbox labels */
.checkbox-label {
    display: flex;
    flex-direction: row; /* ← ИЗМЕНИТЬ с column на row */
    align-items: center; /* ← ИЗМЕНИТЬ с flex-start на center */
    gap: 10px; /* ← УВЕЛИЧИТЬ расстояние */
    margin: 15px 0; /* ← УВЕЛИЧИТЬ отступы */
    cursor: pointer;
    padding: 8px 0; /* ← ДОБАВИТЬ отступы */
}

.checkbox-text {
    font-size: 14px;
    color: #333;
    font-weight: 500; /* ← ДОБАВИТЬ жирность */
}

/* Стили для самого чекбокса */
.checkbox-label input[type="checkbox"] {
    width: 18px; /* ← РАЗМЕР чекбокса */
    height: 18px;
    margin: 0; /* ← УБРАТЬ отступы */
    cursor: pointer;
}

/* User items in admin panel */
.add-user-form {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.add-user-form h4 {
    margin-bottom: 15px;
    color: #333;
}

.add-user-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
    font-size: 14px;
}

.users-list h4 {
    margin-bottom: 15px;
    color: #333;
}

/* Additional modal styles */
.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.modal-content select,
.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
    font-size: 14px;
}

/* User selector improvements */
.user-selector {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
    background: #f8f9fa;
}

.user-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.user-option:hover {
    background: #e9ecef;
}

.user-option input {
    width: auto;
    margin: 0;
}

.user-option label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    flex: 1;
}

.admin-badge {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
}

/* Notes section improvements */
.notes-section h4 {
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #e1e5e9;
    padding-bottom: 5px;
}

.notes-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
}

.notes-list::-webkit-scrollbar {
    width: 6px;
}

.notes-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.notes-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.note-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    position: relative;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.note-author {
    font-weight: 600;
    font-size: 12px;
    color: #667eea;
}

.note-date {
    font-size: 11px;
    color: #999;
}

.note-content {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
}

.note-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    justify-content: flex-end;
}

.add-note-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.note-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 5px;
    font-size: 14px;
    margin: 0;
}

.add-note-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.add-note-btn:hover {
    background: #218838;
}

/* Assigned users in task cards */
.assigned-users {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.user-badge {
    background: #667eea;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Task actions for non-owners */
.task-actions button[title="Просмотреть"] {
    background: #6c757d;
}

.task-actions button[title="Просмотреть"]:hover {
    background: #5a6268;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .user-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .user-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .user-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .logout-btn, .profile-btn {
        width: 100%;
    }
    
    #adminPanel {
        position: static;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .large-modal {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
    
    .add-note-form {
        flex-direction: column;
    }
    
    .note-input {
        margin-bottom: 10px;
    }
    
    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .user-list-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .user-list-info {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
    }
}

/* Column hover effects */
.column {
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.column:hover {
    border-color: #667eea;
}

/* Button variants */
button.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

button.success:hover {
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

button.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

button.danger:hover {
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

button.warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

button.warning:hover {
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty state for columns */
.tasks:empty::after {
    content: 'Нет задач';
    display: block;
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
}

/* Priority indicators */
.priority-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.priority-high .priority-indicator {
    background: #dc3545;
}

.priority-medium .priority-indicator {
    background: #ffc107;
}

.priority-low .priority-indicator {
    background: #28a745;
}

.you-badge {
    margin-left: 5px;
    font-size: 10px;
    color: #667eea;
    font-weight: bold;
}

.creator-badge {
    margin-left: 5px;
    font-size: 10px;
}

.disabled-label {
    opacity: 0.8; /* Делаем менее прозрачным для лучшей читаемости */
    cursor: not-allowed;
}

.restriction-badge {
    margin-left: 5px;
    font-size: 10px;
}

.user-option input:disabled + label {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Стили для user-selector чтобы было понятно, что это для просмотра */
.user-selector.view-mode {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Стили для группы с паролем */
.password-group {
    position: relative;
    margin-bottom: 15px;
}

.password-group input {
    padding-right: 45px !important; /* Место для кнопки */
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease; /* Плавный переход */
}

.toggle-password:hover {
    background: #f0f0f0;
    color: #333;
    transform: translateY(-50%); /* Убираем изменение позиции */
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95); /* Сохраняем позицию при нажатии */
}

/* Специфичные стили для страницы логина */
.login-form .password-group {
    margin-bottom: 20px;
}

.login-form .toggle-password {
    right: 15px;
}

/* Стили для модального окна профиля */
.change-password-section .password-group {
    margin-bottom: 10px;
}

.change-password-section .toggle-password {
    right: 12px;
}