.profile-actions .btn-success {
    background: var(--success-color);
    color: white;
    border: none;
}

.profile-actions .btn-success:hover:not(:disabled) {
    background: #2caa4e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.friendship-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.friendship-status.friend {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
}

.friendship-status.pending {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning-color);
}

.friendship-status.not-friend {
    background: rgba(142, 142, 147, 0.2);
    color: var(--text-muted);
}
.user-profile-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-header {
    text-align: center;
    margin-bottom: 20px;
}

.profile-avatar-large {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-circle);
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow-md);
}

.profile-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px;
    color: var(--text-primary);
}

.profile-header p {
    color: var(--text-muted);
    margin: 0 0 15px;
    font-size: 16px;
}

.user-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
}

.user-status-badge.online {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
}

.user-status-badge.offline {
    background: rgba(142, 142, 147, 0.2);
    color: var(--text-muted);
}

.user-status-badge .status-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-circle);
    flex-shrink: 0;
}

.user-status-badge.online .status-dot {
    background-color: var(--success-color);
    animation: pulse 2s infinite;
}

.user-status-badge.offline .status-dot {
    background-color: var(--text-muted);
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
}

.detail-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.detail-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-actions .btn-primary,
.profile-actions .btn-secondary {
    width: 100%;
    justify-content: center;
}

.profile-actions .btn-primary i,
.profile-actions .btn-secondary i {
    font-size: 14px;
    margin-right: 8px;
}

.profile-actions.friend-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.profile-actions .btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
}

.profile-actions .btn-danger:hover:not(:disabled) {
    background: #e02e24;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.detail-value:empty::before {
    content: 'Не указано';
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 768px) {
    .profile-avatar-large {
        width: 100px;
        height: 100px;
    }
    
    .profile-header h3 {
        font-size: 20px;
    }
    
    .profile-header p {
        font-size: 14px;
    }
    
    .detail-section {
        padding: 16px;
    }
    
    .detail-section h4 {
        font-size: 16px;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .detail-label {
        width: 100%;
        font-size: 13px;
    }
    
    .detail-value {
        font-size: 14px;
    }
    
    .profile-actions.friend-actions {
        grid-template-columns: 1fr;
    }
    
    .user-status-badge {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .profile-avatar-large {
        width: 80px;
        height: 80px;
    }
    
    .profile-header h3 {
        font-size: 18px;
    }
    
    .detail-section {
        padding: 12px;
    }
    
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 11px;
    }
}

.fullscreen-modal {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.fullscreen-modal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.fullscreen-modal .modal-header {
    background: transparent;
    border: none;
}

.fullscreen-modal .close {
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.fullscreen-modal .close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-attachments-count {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-attachments-count:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

@media (max-width: 1200px) {
    .tasks-list-container {
        width: 350px;
    }
}

@media (max-width: 1024px) {
    .task-details-panel {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        max-width: 500px;
        z-index: 200;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 768px) {
    .tasks-list-container {
        width: 100%;
        position: static;
    }
    
    .tasks-container {
        flex-direction: column;
    }
    
    .task-details-panel {
        max-width: 100%;
    }
    
    .task-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .task-detail-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .task-detail-label {
        width: 100%;
    }
    
    .task-actions-panel {
        justify-content: center;
    }
    
    .task-actions-panel button {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .task-stats {
        grid-template-columns: 1fr;
    }
    
    .profile-tab {
        min-width: 100px;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .profile-header {
        padding: 24px 16px;
    }
    
    .profile-section {
        padding: 0 16px;
    }
    
    .task-actions-panel button {
        min-width: 120px;
        font-size: 14px;
        padding: 10px 16px;
    }
}

.scroll-to-bottom-btn {
    position: absolute;
    bottom: 90px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-circle);
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-fast);
    z-index: 10;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.scroll-to-bottom-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-to-bottom-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 171, 238, 0.4);
}

.chat-menu {
    position: fixed;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeInUp 0.2s ease;
}

.chat-menu-content {
    padding: 8px 0;
}

.chat-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-menu-item:hover {
    background: var(--bg-hover);
}

.chat-menu-item i {
    width: 20px;
    color: var(--text-muted);
}

.chat-menu-item.delete {
    color: var(--danger-color);
}

.chat-menu-item.delete:hover {
    background: rgba(255, 59, 48, 0.1);
}

#back-to-list-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin-right: 8px;
}

#back-to-list-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .chat-container {
        height: calc(100vh - 120px);
    }
    
    .scroll-to-bottom-btn {
        bottom: 80px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-avatar-container {
        width: 40px;
        height: 40px;
    }
    
    .message-content {
        max-width: 75%;
    }
    
    .chat-input-container {
        padding: 0px 0px;
    }
    
    .input-action-btn {
        width: 32px;
        height: 32px;
    }
    
    .send-button {
        width: 40px;
        height: 40px;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 189;
    display: none;
}

.chat-overlay.active {
    display: block;
    animation: overlayFadeIn 0.3s ease;
}

@media (max-width: 480px) {
    .chat-item-time {
        font-size: 11px;
    }
    
    .chat-item-unread {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .message-time {
        font-size: 11px;
    }
    
    .message-text {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .chat-messages {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .member-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }
    
    .member-avatar {
        width: 48px;
        height: 48px;
    }
    
    .member-info {
        text-align: center;
    }
}

.chat-area-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-area-full {
    animation: chatSlideIn 0.3s ease;
}

@media (max-width: 360px) {
    .chat-list-header h3 {
        font-size: 18px;
    }
    
    .chat-item {
        padding: 10px 12px;
    }
    
    .chat-item-avatar {
        width: 40px;
        height: 40px;
    }
    
    .chat-item-name {
        font-size: 15px;
    }
    
    .chat-item-last-message {
        font-size: 13px;
    }
    
    .search-input {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .chat-menu {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    .scroll-to-bottom-btn {
        background: var(--primary-color);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
}

.message-input {
    min-height: 40px;
    max-height: 120px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .typing-indicator {
        padding: 8px 16px;
    }
    
    .typing-avatar {
        width: 28px;
        height: 28px;
    }
    
    .typing-text {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .chat-item {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
    
    .message {
        -webkit-tap-highlight-color: transparent;
    }
    
    button {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 768px) {
    .chat-menu-modal {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        margin: 0;
        max-height: 80vh;
        overflow-y: auto;
        animation: modalSlideUp 0.3s ease;
    }
    
    @keyframes modalSlideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background-color var(--transition-fast);
}

.member-item:hover {
    background: var(--bg-hover);
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 500;
    color: var(--text-primary);
}

.member-status {
    font-size: 12px;
    color: var(--text-muted);
}

.member-status.online {
    color: var(--success-color);
}

.member-role {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.task-filters {
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

.task-filter {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.task-filter:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.task-filter.active {
    background: var(--primary-color);
    color: white;
}

.compact-task-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.compact-task-item:hover {
    background: var(--bg-hover);
}

.compact-task-item.active {
    background: var(--bg-active);
    border-left: 4px solid var(--primary-color);
}

.compact-task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.compact-task-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-task-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-pending {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning-color);
}

.status-in_progress {
    background: rgba(42, 171, 238, 0.2);
    color: var(--primary-color);
}

.status-completed {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
}

.status-cancelled {
    background: rgba(142, 142, 147, 0.2);
    color: var(--text-muted);
}

.priority-low {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
}

.priority-medium {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning-color);
}

.priority-high {
    background: rgba(255, 59, 48, 0.2);
    color: var(--danger-color);
}

.priority-urgent {
    background: rgba(255, 59, 48, 0.3);
    color: var(--danger-color);
}

.compact-task-priority {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.compact-task-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.compact-task-time {
    font-size: 12px;
    color: var(--text-muted);
}

.task-progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.task-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.task-details-panel {
    flex: 1;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    z-index: 200;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    display: none;
}

.task-details-panel.open {
    transform: translateX(0);
    display: flex;
}

.task-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.task-details-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.task-details-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.task-details-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.task-details-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.task-details-loading {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.no-task-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
}

.no-task-selected h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.no-task-selected p {
    font-size: 16px;
    max-width: 300px;
    line-height: 1.5;
}

.task-detail-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
}

.task-detail-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.task-detail-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.task-detail-row {
    display: flex;
    margin-bottom: 16px;
    padding: 8px 0;
}

.task-detail-label {
    width: 180px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.task-detail-value {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.task-overdue {
    color: var(--danger-color) !important;
    font-weight: 600;
}

.task-actions-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-top: 32px;
}

.task-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.stat-card {
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.tasks-container {
    display: flex;
    height: calc(100vh - 120px);
    position: relative;
}

.tasks-list-container {
    width: 400px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

.tasks-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.btn-attachments-count {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-attachments-count:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.attachment-thumbnail {
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    padding: 8px;
    text-align: center;
    background: var(--bg-tertiary);
}

.attachment-thumbnail:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.image-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.gallery-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.gallery-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gallery-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.gallery-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

#image-counter {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.current-image-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.current-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

.image-actions {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.current-image-container:hover .image-actions {
    opacity: 1;
}

.btn-action {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-action:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

.image-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.thumbnail {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.thumbnail:hover {
    transform: scale(1.05);
    border-color: var(--border-color);
}

.thumbnail.active {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.other-files {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.other-files h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.file-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.file-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.fullscreen-modal {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.fullscreen-modal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.fullscreen-modal .modal-header {
    background: transparent;
    border: none;
}

.fullscreen-modal .close {
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.fullscreen-modal .close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.task-history-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.task-comments-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.comment-item {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-circle);
    object-fit: cover;
}

.comment-info {
    flex: 1;
}

.comment-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 12px;
    color: var(--text-muted);
}

.comment-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.add-comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-share-preview {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
}

.task-share-preview h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.task-share-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.task-share-details div {
    display: flex;
    gap: 8px;
}

.task-share-details strong {
    min-width: 100px;
    color: var(--text-secondary);
}

@media (max-width: 1200px) {
    .tasks-list-container {
        width: 350px;
    }
}

@media (max-width: 1024px) {
    .task-details-panel {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        max-width: 500px;
        z-index: 200;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 768px) {
    .tasks-list-container {
        width: 100%;
        position: static;
    }
    
    .tasks-container {
        flex-direction: column;
    }
    
    .task-details-panel {
        max-width: 100%;
    }
    
    .task-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .task-detail-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .task-detail-label {
        width: 100%;
    }
    
    .task-actions-panel {
        justify-content: center;
    }
    
    .task-actions-panel button {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .task-stats {
        grid-template-columns: 1fr;
    }
    
    .task-actions-panel button {
        min-width: 120px;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .compact-task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .compact-task-status {
        align-self: flex-start;
    }
}

.modal-content {
    animation: modalFadeIn 0.3s ease-out;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.modal-header .close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
    line-height: 1;
}

.modal-header .close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    background: var(--bg-secondary);
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.modal-body .form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-primary);
    transition: all var(--transition-fast);
}

.modal-body .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.2);
}

.modal-body .form-control::placeholder {
    color: var(--text-muted);
}

.modal-body textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.chat-type-selector {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.chat-type-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.chat-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chat-type-option .option-content {
    padding: 16px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.chat-type-option input[type="radio"]:checked + .option-content {
    background: rgba(42, 171, 238, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(42, 171, 238, 0.1);
}

.chat-type-option:hover .option-content {
    background: var(--bg-hover);
}

.chat-type-option i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
}

.chat-type-option span {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.chat-type-option small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

#chat-members {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 14px;
    overflow-y: auto;
}

#chat-members option {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

#chat-members option:checked {
    background: var(--primary-color);
    color: white;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}
/* Добавьте в style1.css или style2.css */

/* Карточка задачи в чате */
.message-task-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    max-width: 400px;
    margin: 4px 0;
}

.message-task-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.task-card-header {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.task-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.task-card-title i {
    color: var(--primary-color);
}

.task-card-title .task-card-name {
    font-weight: 600;
    color: var(--text-primary);
}

.task-card-badges {
    display: flex;
    gap: 8px;
}

.task-priority-badge,
.task-status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.task-card-body {
    padding: 12px 16px;
}

.task-card-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.task-card-creator,
.task-card-technician,
.task-card-location {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-card-creator img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.task-card-footer {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.task-card-stats {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
}

.task-card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-card-time {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-card-click-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Модальное окно задачи из чата */
.task-modal-from-chat .modal-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.task-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.task-modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.task-modal-title h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.task-modal-badges {
    display: flex;
    gap: 12px;
}

.task-modal-section {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 16px;
}

.task-modal-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.task-modal-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.task-modal-section h4 i {
    color: var(--primary-color);
    font-size: 14px;
}

.task-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.task-modal-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-modal-item label {
    font-size: 12px;
    color: var(--text-muted);
}

.task-modal-item span {
    font-size: 14px;
    color: var(--text-primary);
}

.task-modal-participants {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-modal-participant {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.task-modal-participant img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.participant-role {
    font-size: 12px;
    color: var(--text-muted);
}

.task-modal-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.task-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.task-modal-actions .btn-primary,
.task-modal-actions .btn-secondary {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.task-modal-actions .btn-primary {
    background: var(--primary-color);
    color: white;
}

.task-modal-actions .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.task-modal-actions .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.task-modal-actions .btn-secondary:hover {
    background: var(--bg-hover);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .message-task-card {
        max-width: 100%;
    }
    
    .task-modal-from-chat .modal-content {
        width: 95%;
        margin: 10px auto;
    }
    
    .task-modal-grid {
        grid-template-columns: 1fr;
    }
    
    .task-modal-actions {
        flex-direction: column;
    }
    
    .task-modal-actions button {
        width: 100%;
    }
}
/* Вкладки в модальном окне задачи */
.task-modal-tabs {
    display: flex;
    gap: 4px;
    margin: 20px 0 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.task-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.task-tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.task-tab-btn .tab-count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
}

.task-tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
}

.task-tab-contents {
    margin-bottom: 20px;
}

.task-tab-content {
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.task-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Комментарии */
.task-comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-comment-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.task-comment-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.task-comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.task-comment-content {
    flex: 1;
    min-width: 0;
}

.task-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.task-comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
}

.task-comment-time {
    font-size: 11px;
    color: var(--text-muted);
}

.task-comment-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

/* Вложения в модальном окне */
.task-attachments-list {
    padding: 4px;
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* Стили для вложений в модальном окне задачи */
.attachment-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.attachment-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.attachment-item.image-attachment:hover .attachment-overlay {
    opacity: 1;
}

.attachment-item.file-attachment:hover .attachment-overlay {
    opacity: 1;
}

.attachment-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 24px;
}

.attachment-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.attachment-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 24px;
    color: var(--primary-color);
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Стили для превью изображений в сетке */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* Для изображений можно сделать галерею */
.attachments-grid .image-attachment .attachment-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.attachments-grid .image-attachment {
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
}

.attachments-grid .image-attachment .attachment-info {
    margin-top: 8px;
}

.attachments-grid .image-attachment .attachment-overlay {
    border-radius: 8px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .attachments-grid {
        grid-template-columns: 1fr;
    }
    
    .attachment-item {
        padding: 10px;
    }
    
    .attachments-grid .image-attachment {
        flex-direction: row;
        align-items: center;
    }
    
    .attachments-grid .image-attachment .attachment-image {
        width: 60px;
        height: 60px;
    }
}

/* История */
.task-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.history-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    color: var(--primary-color);
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-action {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.history-item-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.history-item-change {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .task-modal-tabs {
        flex-wrap: wrap;
    }
    
    .task-tab-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .attachments-grid {
        grid-template-columns: 1fr;
    }
    
    .attachment-item {
        padding: 10px;
    }
    
    .task-comment-item {
        padding: 10px;
    }
}