body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    position: fixed;
    /* Torna o cabeçalho fixo */
    top: 0;
    /* Fixa no topo da página */
    left: 0;
    width: 100%;
    /* Garante que o cabeçalho ocupe toda a largura */
    z-index: 1;
    /* Garante que o cabeçalho fique acima de outros elementos */
    background-color: #1351b4;
    /* Cor de fundo */
    color: white;
    padding: 10px 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
}

/* Título menor no responsivo */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.1rem;
        padding: 8px 0;
    }
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-actions button {
    background-color: transparent;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    border: none;
    font-weight: bold;
}

.header-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logout-btn a {
    text-decoration: none;
    color: white;
}

/* Main Content */
main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    margin-top: 70px;
    /* Ajuste o valor para corresponder à altura do cabeçalho */
}

/* Filtros */
.filters {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #1351b4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.filter-btn.active {
    background-color: #0c3a7a;
}

.filter-btn:hover {
    background-color: #0c3a7a;
}

.filter-dropdown {
    margin-left: auto;
}

.filter-dropdown input {
    padding: 8px 16px;
    border-radius: 5px;
    border: 1px solid #1351b4;
    background-color: white;
    color: #1351b4;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Cards de Chamados */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Estilo base para os cards */
.card {
    background-color: white;
    border: 2px solid transparent;
    /* A borda será alterada dinamicamente */
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* O box-shadow será alterado dinamicamente */
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

/* Efeito ao passar o mouse */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Status: Aberto */
.card.status-aberto {
    border-color: #28a745;
    /* Verde */
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.5);
    /* Verde translúcido */
}

/* Status: Em andamento */
.card.status-em-andamento {
    border-color: #ffc107;
    /* Amarelo */
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.5);
    /* Amarelo translúcido */
}

/* Status: Fechado */
.card.status-fechado {
    border-color: #dc3545;
    /* Vermelho */
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.5);
    /* Vermelho translúcido */
}

.card h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #1351b4;
}

.card p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #555;
}

.card .status {
    font-weight: bold;
    font-size: 0.9rem;
}

.card .status.open {
    color: #28a745;
}

.card .status.in-progress {
    color: #ffc107;
}

.card .status.closed {
    color: #dc3545;
}

.card .status.Aberto {
    color: green;
}

.card .status.Emandamento {
    color: orange;
}

.card .status.Fechado {
    color: red;
}

.card .encarregado {
    font-weight: bold;
    color: #1351b4;
}

/* Modal de Detalhes */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1351b4;
}

.modal-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

/* Estilo para os campos do modal de visualização */
.modal-body p {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.modal-body p strong {
    display: block;
    /* Garante que o título fique em uma linha separada */
    margin-bottom: 5px;
    /* Espaçamento abaixo do título */
    color: #1351b4;
    /* Cor do título */
}

.modal-body p span {
    display: block;
    /* Garante que o valor fique em uma nova linha */
    color: #333;
    /* Cor do texto */
    font-weight: normal;
    /* Remove o negrito do texto */
}

.modal-body p strong {
    color: #1351b4;
}

/* Estilo para o botão "Avançar Status" no modal */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.modal-actions button.avancar {
    background-color: #1351b4;
    /* Tom azul */
    color: white;
}

.modal-actions button.avancar:hover {
    background-color: #0c3a7a;
    /* Tom azul mais escuro */
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.modal-actions button.atribuir {
    background-color: #1351b4;
    color: white;
}

.modal-actions button.atribuir:hover {
    background-color: #0c3a7a;
}

/* Modal de Criação de Chamado */
.modal-criar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 10px;
    /* Adiciona espaçamento para telas menores */
    box-sizing: border-box;
    overflow-y: auto;
    /* Adiciona barra de rolagem vertical se necessário */
    z-index: 2;
}

.modal-criar-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 60vw;
    width: 100%;
    /* Garante que o modal ocupe toda a largura em telas menores */
    max-height: 90vh;
    /* Limita a altura do modal a 90% da altura da tela */
    overflow-y: auto;
    /* Adiciona barra de rolagem interna se o conteúdo exceder a altura */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.modal-criar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.modal-criar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1351b4;
}

.modal-criar-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.modal-criar-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-criar-body input,
.modal-criar-body select,
.modal-criar-body textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    width: 100%;
    /* Garante que os campos ocupem toda a largura */
    box-sizing: border-box;
}

.modal-criar-body textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-criar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-criar-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.modal-criar-actions button.criar {
    background-color: #28a745;
    color: white;
}

.modal-criar-actions button.criar:hover {
    background-color: #218838;
}

.modal-criar-actions button.cancelar {
    background-color: #dc3545;
    color: white;
}

.modal-criar-actions button.cancelar:hover {
    background-color: #c82333;
}

/* Estilo para as linhas do modal */
.modal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    /* Espaçamento entre os campos */
    margin-bottom: 15px;
    /* Espaçamento entre as linhas */
    flex-direction: row;
    /* Garante que os inputs fiquem abaixo das labels */
}

/* Cada campo ocupa o mesmo espaço */
.modal-row label {
    font-size: 0.9rem;
    color: #1351b4;
    /* Cor do título */
    margin-bottom: 5px;
    /* Espaçamento entre a label e o input */
    display: block;
    /* Garante que a label ocupe toda a largura */
}

.modal-row input,
.modal-row textarea,
.modal-row select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    width: 100%;
    /* Garante que os campos ocupem toda a largura */
    box-sizing: border-box;
}

/* Ajuste para campos com 2 itens por linha */
.modal-row.p-50-50>div {
    flex: 1 1 45%;
    /* Cada campo ocupa 50% da largura */
    max-width: 45%;
    /* Limita a largura máxima a 50% */
    box-sizing: border-box;
    /* Inclui padding e borda no cálculo da largura */
}

/* Ajuste para campos com 3 itens por linha */
.modal-row .p-33-33-33 {
    flex: 1 1 30%;
    /* Cada campo ocupa 33% da largura */
    max-width: 30%;
    /* Limita a largura máxima a 33% */
    box-sizing: border-box;
    /* Inclui padding e borda no cálculo da largura */
}

/* Responsividade para telas menores */
@media (max-width: 768px) {

    .modal-row.p-50-50>div,
    .modal-row .p-33-33-33 {
        flex: 1 1 100%;
        /* Campos ocupam 100% da largura em telas menores */
        max-width: 100%;
    }
}

/* Responsividade para telas menores */
@media (max-width: 768px) {
    .modal-row {
        flex-direction: column;
        /* Empilha os campos verticalmente em telas menores */
    }

    .modal-row p,
    .modal-row input,
    .modal-row textarea,
    .modal-row select {
        flex: 1;
        /* Garante que os campos ocupem toda a largura */
        max-width: 100%;
        /* Garante que os campos ocupem 100% da largura */
    }
}

/* Responsividade para telas menores */
@media (max-width: 768px) {
    .modal-row.p-50-50 {
        flex-direction: column;
        /* Empilha os campos verticalmente em telas menores */
    }

    .modal-row.p-50-50 p {
        flex: 1;
        /* Garante que os campos ocupem toda a largura */
        max-width: 100%;
        /* Garante que os campos ocupem 100% da largura */
    }
}

/* Responsividade para telas menores */
@media (max-width: 768px) {
    .modal-row {
        flex-direction: column;
        /* Empilha os campos verticalmente em telas menores */
    }

    .modal-row p {
        flex: 1;
        /* Garante que os campos ocupem toda a largura */
        max-width: 100%;
        /* Garante que os campos ocupem 100% da largura */
    }
}

/* Estilo para o contêiner de imagens */
.imagens-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.imagens-container img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.imagens-container img:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* Modal Actions e Botões */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    border: none;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ccc;
    color: #333;
}

/* Hamburguer */
.menu-hamburguer {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: 10px;
    z-index: 11;
}
.menu-hamburguer span {
    display: block;
    width: 28px;
    height: 4px;
    margin: 4px 0;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .menu-hamburguer {
        display: flex !important;
    }
    .header-actions > #abrirChamadoBtn,
    .header-actions > .logout-btn,
    .header-actions > #abrirCadastroBtn,
    .header-actions > #btnChamados{
        display: none !important;
    }
}

/* Overlay do menu hamburguer ocupando 80% da direita com animação */
.menu-dropdown {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    width: 80vw;
    max-width: 350px;
    height: 100vh;
    background: #1351b4;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    z-index: 1001; /* Maior que o overlay */
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
    border-radius: 0;
    min-width: unset;
    padding: 40px 24px 0 24px;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(.77,0,.18,1), opacity 0.25s;
    opacity: 0;
    pointer-events: none;
}
.menu-dropdown.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}
.menu-dropdown.closing {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Overlay escuro para o restante da tela */
.menu-overlay-bg {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(100,100,100,0.4); /* cinza translúcido */
    z-index: 999; /* Menor que o menu */
    transition: opacity 0.35s cubic-bezier(.77,0,.18,1);
    opacity: 0;
    pointer-events: none;
}
.menu-overlay-bg.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Footer */
footer {
    background-color: #1351b4;
    color: white;
    text-align: center;
    padding: 10px 20px;
    margin-top: auto;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

footer p {
    margin: 0;
}

footer img {
    height: 30px;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Imagens Container */
.imagens-container img {
    width: 100px;
    height: auto;
    margin-right: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.imagens-container img:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
}

.modal-criar-content {
    position: relative;
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    margin: auto;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.header-left h2 {
    margin: 0;
    font-size: 1.4rem;
}

.created-date {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #666;
}

.badge-status {
    background-color: #ffe599;
    color: #8a6d3b;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    height: fit-content;
}

.badge-status--aberto {
    background-color: #28a745 !important; /* verde */
    color: #fff !important;
}
.badge-status--em-andamento {
    background-color: #ffc107 !important; /* amarelo */
    color: #333 !important;
}
.badge-status--fechado {
    background-color: #dc3545 !important; /* vermelho */
    color: #fff !important;
}

.section {
    margin-top: 24px;
    border: 1px solid #e0e0e0;
    padding: 16px;
    border-radius: 8px;
    background: #f9f9f9;
}

.modal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.p-50-50>p {
    flex: 1 1 48%;
}

.p-33-33-33>p {
    flex: 1 1 30%;
}

.imagens-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.imagens-container img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    border: none;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ccc;
    color: #333;
}

/* Modal de visualização de imagem */
#imagemModal {
    display: none; /* ou flex, dependendo do seu JS */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

#imagemModalSrc {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    background: #fff;
    padding: 8px;
    display: block;
}

#closeImagemModal {
    position: absolute;
    top: 32px;
    right: 48px;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
}

.close-menu-dropdown {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    position: absolute;
    top: 18px;
    right: 24px;
    cursor: pointer;
    z-index: 1002;
}

.botoes-imagem {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-imagem {
    display: inline-block !important;
    padding: 1px 8px;
    background: #fff;
    color: #0056b3 !important;
    border: 1px solid #0056b3;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    font-size: 1rem !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.btn-imagem:hover, .btn-imagem:focus {
    background: #0056b3;
    color: #fff !important;
    text-decoration: none;
}

#imagensPreviewContainer, #editarPreviewImagensChamado{
    width: 100%;
}