* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.top-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5299 100%);
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.system-name h1 {
    font-size: 22px;
    font-weight: 600;
}

.system-name span {
    font-weight: 300;
    opacity: .9;
}

.system-name {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 45px;
    width: auto;
}


.user-info {
    display: flex;
    align-items: center;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, .3);
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-details span {
    font-weight: 600;
}

.user-details a {
    color: #bde0ff;
    font-size: 12px;
    text-decoration: none;
}

.container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #1a4b8c 0%, #2a5299 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.logo {
    text-align: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    margin-bottom: 20px;
}

.logo img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.logo img {
    max-height: 110px;
    /* Ajuste este valor conforme necessário */
}


.menu {
    list-style: none;
    padding-left: 0;
}

.menu-item {
    padding: 0;
    /* Removido para ser controlado pelo conteúdo ou pelo item diretamente */
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all .2s;
}

.submenu-item[onclick] {
    cursor: pointer;
}


.menu-item.has-submenu {
    position: relative;
    /* Necessário para o posicionamento absoluto do submenu */
}

.menu-item-content {
    display: flex;
    padding: 15px 25px;
    /* Padding principal fica aqui */
    align-items: center;
}

.menu-item:hover {
    background: rgba(255, 255, 255, .06);
}

.menu-item.active {
    /* O estilo de ativo será aplicado no JS para itens com submenu */
}

.menu-item.active:not(.has-submenu) {
    background: rgba(255, 255, 255, .12);
    border-left: 4px solid #4CAF50;
}

.menu-item i {
    margin-right: 12px;
}

.submenu {
    list-style: none;
    padding-left: 0;
    margin: 0 0 10px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.submenu-item {
    padding: 10px 25px 10px 50px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.submenu-item.active {
    font-weight: bold;
    background: rgba(255, 255, 255, 0.15);
}

.submenu-item i {
    margin-right: 12px;
}

.sidebar .menu-item.has-submenu .fa-chevron-down,
.sidebar .menu-item.has-submenu .fa-chevron-up {
    margin-left: auto;
    transition: transform 0.3s;
}

.sidebar .menu-item.has-submenu.open .fa-chevron-down {
    transform: rotate(-180deg);
}

/* Estilo para itens de menu sem submenu */
.menu-item:not(.has-submenu) {
    padding: 15px 25px;
    display: flex;
    align-items: center;
}

/* Estilo para o item de menu que é um link <a> */
a.menu-item {
    text-decoration: none;
    color: white;
}

/* Controle de visibilidade das seções principais */
.section {
    display: none;
}

.section.active {
    display: block;
}


.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.alert-banner {
    background: linear-gradient(135deg, #ff4b2b 0%, #ff416c 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.banner-normalidade {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    /* Verde */
}

.banner-atencao {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    /* Amarelo */
    color: #333;
    /* Texto mais escuro para contraste */
}

.banner-alerta {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    /* Vermelho */
}

.banner-maximo {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    /* Roxo/Vinho para alerta máximo */
}


.welcome-message {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6e6e6;
}

.header h2 {
    color: #2a5299;
    font-size: 20px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.quick-actions button {
    flex: 1 1 calc(50% - 10px);
    background: #2a5299;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-actions button i {
    margin-right: 8px;
}

.quick-actions button:hover {
    background: #1e3c72;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: #2a5299;
}

.card-header i {
    font-size: 20px;
    margin-right: 10px;
}

.stat {
    font-size: 28px;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 6px;
}

.card-list {
    list-style: none;
    padding-left: 0;
}

.card-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f3f3f3;
    display: flex;
    align-items: center;
}

.card-list li:last-child {
    border-bottom: none;
}

.progress-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

/* Modal basic */
.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal .modal-inner {
    background: white;
    border-radius: 8px;
    padding: 18px;
    width: 95%;
    max-width: 520px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #333;
}

.modal .modal-inner {
    position: relative;
}

.modal .modal-header {
    font-weight: 700;
    color: #c82333;
    margin-bottom: 10px;
}

.modal .modal-body label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.modal .modal-body input,
.modal .modal-body select,
.modal .modal-body textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Adiciona scroll ao corpo do modal quando o conteúdo é muito grande */
.modal .modal-body {
    max-height: 70vh;
    /* Limita a altura a 70% da altura da tela */
    overflow-y: auto;
    /* Adiciona a barra de rolagem vertical quando necessário */
    padding-right: 15px;
    /* Espaço para a barra de rolagem não sobrepor o conteúdo */
}


.modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-primary {
    background: #2a5299;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-danger {
    background: #c82333;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

/* Estilos para o monitoramento */
.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.monitor-status {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}



.status-offline {
    background-color: #f44336;
}

.status-warning {
    background-color: #FFC107;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.monitor-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.monitor-card.risk {
    border-left-color: #4CAF50;
}

.monitor-card.alerts {
    border-left-color: #FFC107;
}

.monitor-card.teams {
    border-left-color: #2196F3;
}

.monitor-card.impact {
    border-left-color: #9C27B0;
}

.monitor-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.monitor-value {
    font-size: 20px;
    font-weight: bold;
    color: #1e3c72;
}

.monitor-update {
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gauge-container {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.gauge {
    flex: 1;
    text-align: center;
    padding: 10px;
}

.gauge-value {
    font-size: 18px;
    font-weight: bold;
    color: #2a5299;
}

.gauge-label {
    font-size: 12px;
    color: #666;
}

/* Estilos para a seção de recursos (veículos) */
.resource-filters {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2a5299;
    font-size: 14px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.vehicles-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.vehicles-table th {
    background-color: #2a5299;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.vehicles-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.vehicles-table tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    color: #2e7d32;
    background-color: #86fd8c;
    /* Mantém apenas a cor do texto verde */
}

.status-inactive {
    background-color: #ffebee;
    color: #c62828;
}

.status-mobilized {
    background-color: #fff8e1;
    color: #f57c00;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-right: 5px;
}

.btn-mobilize {
    background-color: #ff9800;
    color: white;
}

.btn-demobilize {
    background-color: #f44336;
    color: white;
}

.btn-details {
    background-color: #2196f3;
    color: white;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.pagination {
    display: flex;
    gap: 5px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.pagination-btn.active {
    background-color: #2a5299;
    color: white;
    border-color: #2a5299;
}

.summary-info {
    font-size: 14px;
    color: #666;
}

/* Novos estilos para a seção de monitoramento */
.monitor-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2a5299;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.monitor-item-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.monitor-item-value {
    font-size: 18px;
    font-weight: bold;
    color: #1e3c72;
    margin-bottom: 5px;
}

.monitor-item-update {
    font-size: 12px;
    color: #999;
}

.monitor-item-status {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.monitor-item-status .status-indicator {
    margin-right: 5px;
}

.weather-station {
    border-left-color: #4CAF50;
}

.rain-gauge {
    border-left-color: #2196F3;
}

.monitor-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.monitor-detail-item {
    text-align: center;
    padding: 8px;
    background: rgba(42, 82, 152, 0.05);
    border-radius: 4px;
}

.monitor-detail-value {
    font-size: 16px;
    font-weight: bold;
    color: #2a5299;
}

.monitor-detail-label {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.action-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-nao-iniciada {
    background-color: #f0f0f0;
    color: #888;
}

.status-em-andamento {
    background-color: #fff8e1;
    color: #f57c00;
}

.status-concluida {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-cancelada {
    background-color: #ffebee;
    color: #c62828;
}

/* Estilos para a área de upload de arquivo */
.file-drop-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: background-color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.file-drop-area.dragover {
    background-color: #eef4ff;
    border-color: #2a5299;
}

.file-drop-area input[type="file"] {
    display: none;
}

/* Estilos para listas de recursos mobilizados no modal de ação */
.mobilized-list-container {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    min-height: 100px;
}

.mobilized-list-container strong {
    font-size: 13px;
    color: #333;
}

.mobilized-list {
    list-style: none;
    padding-left: 0;
    margin-top: 8px;
}

.mobilized-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background-color: #fff;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 14px;
}

.remove-mobilized-item {
    cursor: pointer;
    color: #c82333;
}

/* Estilos para o mapa interativo */
#map-container {
    padding: 10px;
}

#map {
    height: 450px;
}

/* Estilos para o modal de detalhes (visualização) */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2a5299;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.detail-section-title i {
    margin-right: 8px;
}

.detail-item {
    margin-bottom: 8px;
}

.detail-label {
    font-weight: 600;
    color: #555;
    display: block;
}

/* Estilos para as abas do modal */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.modal-tab-button {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1rem;
    color: #666;
    position: relative;
    transition: color 0.3s;
}

.modal-tab-button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #2a5299;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.modal-tab-button.active {
    color: #2a5299;
    font-weight: 600;
}

.modal-tab-button.active::after {
    transform: scaleX(1);
}

/* Estilos para as abas de atribuições */
.assignment-tab-pane {
    display: none;
}

.assignment-tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

.assignment-list {
    list-style-type: none;
    padding-left: 0;
}

.assignment-list li {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid;
}

.tab-prevencao.active {
    color: #2e7d32;
}

.tab-prevencao::after {
    background-color: #4CAF50;
}

.assignment-tab-pane#prevencao .assignment-list li {
    border-left-color: #4CAF50;
}

.tab-preparacao.active {
    color: #f57c00;
}

.tab-preparacao::after {
    background-color: #FFC107;
}

.assignment-tab-pane#preparacao .assignment-list li {
    border-left-color: #FFC107;
}

.tab-resposta.active {
    color: #c62828;
}

.tab-resposta::after {
    background-color: #f44336;
}

.assignment-tab-pane#resposta .assignment-list li {
    border-left-color: #f44336;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Botão do menu hambúrguer escondido por padrão em telas grandes */
.menu-toggle {
    display: none;
}

/* --- Estilos para a Seção de Comunicação --- */

.comms-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.comms-sidebar,
.comms-main {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.comms-sidebar {
    padding: 20px;
}

.comms-main {
    padding: 0;
    overflow: hidden;
}

.comms-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #2a5299;
}

.comms-section-title i {
    color: #2a5299;
}

.comms-section-title h2 {
    font-size: 1.1rem;
    color: #2a5299;
}

.comms-tabs {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.comms-tab {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
}

.comms-tab.active {
    border-bottom: 3px solid #2a5299;
    color: #2a5299;
    background-color: white;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content#chat-tab.active {
    display: flex;
    flex-direction: column;
}

.tab-content.active {
    display: block;
}



.chat-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.chat-messages {
    flex-grow: 1;
    /* Faz esta área crescer para preencher o espaço */
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    max-width: 80%;
}

.message.received {
    background-color: #f1f3f5;
    margin-right: auto;
}

.message.sent {
    background-color: #2a5299;
    color: white;
    margin-left: auto;
}

.message-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.message-input {
    display: flex;
    gap: 10px;
}

.message-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.message-input button {
    background-color: #2a5299;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.message-input button:hover {
    background-color: #1e3c72;
}

.contact-list {
    list-style: none;
    margin-top: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contact-item:hover {
    background-color: #f8f9fa;
}

.contact-item.active {
    background-color: #eef4ff;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2a5299;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 500;
}

.contact-status {
    font-size: 0.8rem;
    color: #666;
}

.contact-status.status-online {
    color: #2e7d32;
}

.status-busy {
    color: #f57c00;
}

.priority-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: auto;
}

.priority-high {
    background-color: #c82333;
}

.priority-medium {
    background-color: #f57c00;
}

.priority-low {
    background-color: #4CAF50;
}

.emergency-btn {
    background-color: #c82333;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    justify-content: center;
    transition: background-color 0.3s;
}

.emergency-btn:hover {
    background-color: #a71d2a;
}

/* --- Estilos para a Aba de Rádio Comunicação --- */

.radio-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.radio-control {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #eee;
}

.radio-control i {
    font-size: 2rem;
    color: #8e44ad;
    /* Cor roxa para rádio */
    margin-bottom: 10px;
}

.radio-control h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.radio-control p {
    font-size: 0.9rem;
    color: #666;
}

.radio-control button {
    background-color: #8e44ad;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: background-color 0.3s;
}

.radio-control button.active {
    background-color: #27ae60;
}

.radio-log {
    height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 10px;
    background-color: #f8f9fa;
    font-family: monospace;
    font-size: 0.9rem;
}

.log-entry {
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid #8e44ad;
}

.log-time {
    color: #666;
    font-size: 0.8rem;
}

.radio-transmit {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.radio-transmit input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.radio-transmit button {
    background-color: #8e44ad;
    /* Cor roxa para rádio */
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* --- Estilos para a Aba de Transmissão em Massa --- */

.broadcast-form-group {
    margin-top: 20px;
}

.broadcast-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.broadcast-form-group select,
.broadcast-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

/* --- Estilos para o Modal de Cadastro Automático de Alerta --- */

.alert-box {
    background-color: #fff8e1;
    border-left: 5px solid #f57c00;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    color: #333;
}

.file-upload {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.file-upload:hover {
    border-color: #17a2b8;
    background-color: #f8f9fa;
}

.file-upload input {
    display: none;
}

.file-info {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.extracted-data {
    background-color: #e8f4fd;
    border-left: 5px solid #2a5299;
    padding: 15px;
    margin-top: 20px;
    border-radius: 5px;
    display: none;
    /* Começa escondido */
}

.extracted-data h4 {
    margin-bottom: 10px;
    color: #1e3c72;
}

.data-item {
    margin-bottom: 8px;
    display: flex;
}

.data-label {
    font-weight: 600;
    min-width: 150px;
}

.form-section {
    margin-bottom: 25px;
}

.form-section h3 {
    margin-bottom: 15px;
}

/* Estilo para exibir o arquivo anexado no modal de alerta */
.file-display-card {
    background-color: #eef4ff;
    border: 1px solid #b8d4ff;
    border-radius: 5px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #1e3c72;
}

.file-display-card i {
    font-size: 18px;
}

.file-display-card a {
    color: #1e3c72;
    font-weight: 600;
}

/* --- Media Queries para Responsividade --- */

/* Tablets e telas menores (ex: iPads em modo retrato) */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -250px;
        /* Esconde o sidebar fora da tela */
        height: 100%;
        transition: left 0.3s ease;
        z-index: 1100;
        /* Garante que o sidebar fique sobre o conteúdo */
    }

    .sidebar.open {
        left: 0;
        /* Mostra o sidebar */
    }

    .main-content {
        padding: 20px;
    }

    .dashboard {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    /* Adicionar um botão para abrir/fechar o menu */
    .menu-toggle {
        display: block;
        background: transparent;
        color: white;
        border: none;
        font-size: 22px;
        cursor: pointer;
        padding: 0 10px;
        margin-right: 10px;
    }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050;
    }

    .overlay.active {
        display: block;
    }
}

/* Celulares */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 250px;
        /* Mantém a largura quando aberto */
        height: 100vh;
        position: fixed;
        left: -250px;
        /* Começa escondido */
    }

    .main-content {
        width: 100%;
        padding: 15px;
    }

    .top-header {
        /* Mantém o alinhamento horizontal, mas ajusta o espaçamento */
        padding: 15px;
        gap: 15px;
        flex-wrap: wrap;
        /* Permite que o user-info quebre a linha se não houver espaço */
    }

    .system-name h1 {
        font-size: 18px;
    }

    /* Esconde o subtítulo do sistema em telas pequenas */
    .system-name span {
        display: none;
    }

    /* Esconde os detalhes do usuário (nome e link de sair), mantendo só o avatar */
    .user-details {
        display: none;
    }


    .quick-actions button {
        flex-basis: 100%;
    }

    .dashboard,
    .monitor-grid {
        grid-template-columns: 1fr;
    }

    .vehicles-table-container {
        overflow-x: auto;
        /* Permite rolagem horizontal na tabela */
    }

    .modal .modal-inner {
        width: 95%;
        max-width: 95%;
    }

    .comms-container {
        grid-template-columns: 1fr;
    }

    .radio-controls {
        grid-template-columns: 1fr;
    }

    .data-item {
        flex-direction: column;
    }

    .data-label {
        min-width: auto;
        margin-bottom: 5px;
    }
}

/* --- Estilos para Ícones Customizados do Mapa (Pluviômetros) --- */
.custom-gauge-icon {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.custom-gauge-icon div {
    transform: rotate(45deg);
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.custom-gauge-icon i {
    font-size: 14px;
    margin: 0;
    line-height: 1;
}

.custom-gauge-icon span {
    font-size: 12px;
    line-height: 1;
}

/* Cores baseadas no nível de chuva */
.gauge-icon-low {
    background-color: #4CAF50;
    /* Verde */
}

.gauge-icon-medium {
    background-color: #FFC107;
    /* Amarelo */
    color: #333;
    /* Texto escuro para contraste */
}

.gauge-icon-high {
    background-color: #fb8c00;
    /* Laranja */
}

.gauge-icon-very-high {
    background-color: #e53935;
    /* Vermelho */
}

/* --- Estilos para o Botão de Tela Cheia do Mapa --- */
#map-container {
    position: relative;
}

/* Estilo para botões customizados do Leaflet (como Legenda e Tela Cheia) */
.leaflet-control-custom a {
    text-decoration: none;
    color: #333;
    font-size: 1.2em;
}

/* --- Estilos para a Legenda do Mapa --- */
.leaflet-control.legend {
    padding: 8px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    line-height: 1.5;
    color: #333;
}

.leaflet-control-custom a {
    text-decoration: none;
    color: #333;
    font-size: 1.2em;
}

.leaflet-control.legend h4 {
    margin-top: 0;
    margin-bottom: 8px;
    text-align: center;
    font-size: 13px;
}

.leaflet-control.legend .legend-section {
    margin-bottom: 5px;
}

.leaflet-control.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
    opacity: 0.7;
}