/* Modal de eventos do projeto */
#modalEventos .modal-dialog {
    max-width: 95%;
    margin: 1rem auto;
}

/* Telas menores: mesmo .modal-fullscreen do atendimento (99% / calc(100vh - 28px)) */
#modalEventos .modal-dialog.modal-fullscreen {
    max-width: 1980px !important;
    width: 99% !important;
    height: calc(100vh - 28px) !important;
    margin: 0.5rem auto !important;
}

#modalEventos .modal-content {
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

#modalEventos .modal-fullscreen .modal-content {
    height: 100% !important;
    max-height: calc(100vh - 28px) !important;
}

#modalEventos .modal-header {
    background-color: #D94F04;
    flex-shrink: 0;
}

#modalEventos .modal-title {
    color: #fff;
}

#modalEventos .modal-header .close {
    color: #fff;
    opacity: 0.9;
    text-shadow: none;
}

#modalEventos .modal-header .close:hover {
    color: #fff;
    opacity: 1;
}

#modalEventos .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* Evita padding:0 / overflow:hidden do .modal-fullscreen genérico */
#modalEventos .modal-fullscreen .modal-body {
    overflow-y: auto !important;
    padding: 1rem;
    flex: 1 1 auto;
    min-height: 0;
}

#modalEventos .modal-footer {
    flex: 0 0 auto;
    flex-shrink: 0;
    max-height: 52px;
    padding: 0.35rem 0.75rem;
    align-items: center;
}

/* Conteúdo do show do evento */
.evento-projeto-show .chat-input {
    display: flex;
    gap: 5px;
    align-items: stretch;
}

.evento-projeto-show .chat-input input[type="text"] {
    flex: 1;
    min-width: 0;
}

.evento-projeto-show .chat-input button {
    flex-shrink: 0;
    white-space: nowrap;
}

.evento-projeto-show .observacoes-lista-container {
    max-height: 400px;
    overflow-y: auto;
}

.evento-projeto-show .direct-chat-img-small {
    display: inline-block;
    height: 25px;
    width: 25px;
    border-radius: 50%;
    vertical-align: middle;
    object-fit: cover;
}

.evento-projeto-show td .direct-chat-img-small.fa-robot {
    font-size: 1rem;
    line-height: 25px;
    text-align: center;
}

@media (min-width: 992px) {
    .evento-projeto-show .border-left-lg {
        border-left: 1px solid #dee2e6;
    }
}

@media (max-width: 991px) {
    .evento-projeto-show .border-left-lg {
        border-left: none;
        padding-left: 0 !important;
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    .evento-projeto-show .chat-input {
        flex-direction: column;
    }

    .evento-projeto-show .chat-input input[type="text"] {
        width: 100%;
        margin-bottom: 5px;
    }

    .evento-projeto-show .chat-input button {
        width: 100%;
        align-self: flex-end;
    }
}

/* Formulário de edição no modal */
.evento-projeto-edit .form-group label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.evento-projeto-edit-acoes {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

/* Painel Atividades (split 7/5) */
#modalEventos .modal-body:has(.evento-detalhes-conteudo) {
    overflow: hidden !important;
    padding: 0 !important;
    flex: 1 1 auto;
    min-height: 0;
}

.evento-detalhes-conteudo {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    align-items: stretch;
    --evento-detalhe-h: calc(100vh - 11rem);
    height: var(--evento-detalhe-h);
    max-height: var(--evento-detalhe-h);
    overflow: hidden;
}

.evento-detalhes-conteudo > .col-lg-7 {
    height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 10px !important;
}

.evento-detalhes-conteudo > .col-lg-5 {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    padding: 0 !important;
    border-left: 1px solid #dee2e6;
}

.evento-atividades-painel {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    margin-bottom: 0 !important;
    overflow: hidden;
    border-radius: 0;
    border: 0;
}

.evento-atividades-painel > .card-header,
.evento-atividades-painel > .card-footer {
    flex: 0 0 auto;
}

.evento-atividades-feed {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    background-color: #f4f6f9;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.evento-atividades-feed .evento-ativ-card {
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.evento-ativ-composer.dragover {
    outline: 2px dashed #007bff;
    outline-offset: -2px;
    background: rgba(0, 123, 255, 0.04) !important;
}

.evento-ativ-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.evento-ativ-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.evento-ativ-avatar {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
}

.evento-ativ-card-body {
    font-size: 0.9rem;
    word-break: break-word;
}

.evento-ativ-anexos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.evento-ativ-anexo-img {
    display: block;
    max-width: 180px;
    text-decoration: none;
    color: inherit;
}

.evento-ativ-anexo-img img {
    display: block;
    max-width: 100%;
    max-height: 140px;
    border-radius: 0.35rem;
    border: 1px solid #e9ecef;
    object-fit: cover;
}

.evento-ativ-anexo-nome {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.evento-ativ-anexo-file {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.35rem;
    font-size: 0.8rem;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
}

.evento-ativ-anexo-file:hover {
    background: #e9ecef;
    text-decoration: none;
}

.evento-ativ-hist {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0.15rem;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.evento-ativ-hist-bullet {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #adb5bd;
    margin-top: 0.45rem;
    flex-shrink: 0;
}

.evento-ativ-hist-conteudo {
    display: flex;
    flex: 1;
    min-width: 0;
    justify-content: space-between;
    gap: 0.75rem;
}

.evento-ativ-hist-texto {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.evento-ativ-hist-data {
    flex-shrink: 0;
    text-align: right;
}

.evento-obs-anexos-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.evento-obs-anexo-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid #ced4da;
    border-radius: 0.35rem;
    background: #f8f9fa;
    font-size: 0.75rem;
    max-width: 100%;
}

.evento-obs-anexo-chip img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.evento-obs-anexo-chip .nome {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.evento-ativ-filtros .btn.active {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

@media (max-width: 991.98px) {
    #modalEventos .modal-body:has(.evento-detalhes-conteudo) {
        overflow-y: auto !important;
    }

    .evento-detalhes-conteudo {
        height: auto !important;
        max-height: none !important;
        overflow: visible;
    }

    .evento-detalhes-conteudo > .col-lg-7,
    .evento-detalhes-conteudo > .col-lg-5 {
        height: auto;
        max-height: none;
        overflow: visible;
        border-left: 0;
    }

    .evento-atividades-painel {
        height: auto;
        max-height: none;
        min-height: 360px;
    }

    .evento-atividades-feed {
        max-height: 40vh;
    }
}
