* {
    box-sizing: border-box;
}

body {
    margin: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f3f6f8;

    color: #333;
}

/* LOGIN */

.login-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #06131f;
}

#topo-canvas {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 0;
}

.login-container {
    position: relative;
    z-index: 1;

    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 430px;

    background: rgba(255, 255, 255, 0.92);

    padding: 45px;

    border-radius: 16px;

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.35);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-logo {
    display: block;

    max-width: 220px;
    width: 100%;

    margin: 0 auto 25px auto;
}

.login-box h1 {
    margin-top: 0;
    margin-bottom: 10px;

    color: #333;
}

.subtitle {
    color: #666;

    margin-bottom: 30px;
}

label {
    display: block;

    margin-top: 18px;
    margin-bottom: 7px;

    font-weight: bold;
}

input {
    width: 100%;

    padding: 13px;

    border: 1px solid #ccc;

    border-radius: 6px;

    font-size: 15px;

    background: rgba(255, 255, 255, 0.95);
}

button {
    width: 100%;

    margin-top: 25px;

    padding: 14px;

    background: #126096;

    color: white;

    border: 0;

    border-radius: 6px;

    cursor: pointer;

    font-size: 15px;
}

button:hover {
    background: #0b4d7a;
}

.erro {
    background: #ffe5e5;

    padding: 10px;

    border-radius: 5px;

    color: #9b1c1c;
}

/* DASHBOARD */

.topbar {
    background: white;

    padding: 18px 40px;

    display: flex;

    justify-content: space-between;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.08);
}


.topbar a {
    text-decoration: none;

    color: #126096;
}

/* DASHBOARD */

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;

    font-family: Arial, Helvetica, sans-serif;
    background: #f3f6f8;
    color: #333;

    overflow: hidden;
}

.topbar {
    height: 75px;

    background: white;

    padding: 0 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.08);

    z-index: 10;
}

.topbar a {
    text-decoration: none;
    color:#0b4d7a;
    text-decoration: underline;
}

.map-container {
    flex: 1;
    width: 100%;
    min-height: 0;
}

.map-container iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.logo-header {
    max-height: 50px; /* Reduz e fixa a altura limite da logo */
    width: auto;      /* Mantém a proporção original */
    display: block;
}

.cabecalho {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cabecalho h1 {
    padding-left: 20px;
    margin: 0;
    line-height: 1;
    font-size: 25px;
    color: #313133;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-header {
    height: 50px;
    width: auto;
    display: block;
}

.divider {
    font-size: 25px;
    color: #333333;
    line-height: 1;    
}

/* =========================================================
   LAYOUT PRINCIPAL
   ========================================================= */

.app-layout {
    display: flex;
    width: 100%;
    height: calc(100vh - 75px);
    overflow: hidden;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: 220px;
    height: 100%;

    background: #0a2238;

    display: flex;
    flex-direction: column;

    padding: 12px;
    gap: 8px;

    transition: width 0.25s ease;

    box-shadow: 3px 0 12px rgba(0, 0, 0, 0.15);

    z-index: 50;
}


/* sidebar fechada */

.sidebar.collapsed {
    width: 70px;
}

/* botão ☰ */

.sidebar-toggle {
    width: 46px;
    height: 46px;

    margin: 0 0 4px 0;
    padding: 0;

    border: none;
    border-radius: 8px;

    background: rgba(255, 255, 255, 0.12);
    color: white;

    font-size: 22px;

    cursor: pointer;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* =========================================================
   BOTÕES MAPA / DASHBOARD
   ========================================================= */

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;

    width: calc(100% - 20px);
    min-height: 48px;
    margin: 4px 10px;
    padding: 0 20px;

    border: none;
    border-radius: 10px;

    background: transparent;
    color: white;

    cursor: pointer;
    box-sizing: border-box;
}

/* Ícone */
.sidebar-icon {
    width: 20px;
    height: 20px;

    flex: 0 0 20px;
    object-fit: contain;

    /* preto -> branco */
    filter: brightness(0) invert(1);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

/* Item selecionado */
.menu-item.active {

    background: white;
    color: #0a2238;
}

/* Ícone selecionado: azul */
.menu-item.active .sidebar-icon {
    filter:
        brightness(0)
        saturate(100%)
        invert(25%)
        sepia(34%)
        saturate(1800%)
        hue-rotate(165deg)
        brightness(75%);
}


/* Texto */
.menu-item span {
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.15s ease;
}

.menu-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}


.menu-text {
    white-space: nowrap;
}


/* esconde o texto quando recolher */

.sidebar.collapsed .menu-text {
    display: none;
}


/* =========================================================
   MAPA / DASHBOARD
   ========================================================= */

.content-area {
    flex: 1;

    min-width: 0;
    height: 100%;

    position: relative;

    background: white;
}


.content-frame {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    border: none;

    display: none;
}


.content-frame.active {
    display: block;
}


/* =========================================
   SIDEBAR FECHADA
   ========================================= */

.sidebar.collapsed .menu-item {
    width: 46px;
    height: 46px;
    min-height: 40px;

    margin: 4px auto;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 0;
    border-radius: 9px;
}

/* Esconde completamente o texto */
.sidebar.collapsed .menu-item span {
    display: none;
}

@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    /* ===== CABEÇALHO ===== */

    .topbar {
        height: 72px;
        min-height: 72px;
        padding: 0 12px;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    .cabecalho {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    .logo-link {
        flex-shrink: 0;
    }

    .logo-header {
        width: 135px;
        height: auto;
        display: block;
    }

    .cabecalho h1 {
        font-size: 17px;
        line-height: 1.05;
        margin: 0;
        white-space: normal;
        overflow: visible;
    }

    .botao_sair {
        font-size: 13px;
        padding: 7px 9px;
        flex-shrink: 0;
    }
    
    /* ===== MENU LATERAL ===== */

    .sidebar {
        width: 190px;
        padding: 12px;
        transition: width 0.25s ease;
    }

    .sidebar.collapsed {
        width: 72px;
    }

    /* botão de abrir/fechar */
    .sidebar-toggle {
        width: 48px;
        height: 48px;
        margin: 10px auto;
    }

    /* botões quando a sidebar está ABERTA */
    .sidebar .menu-item {
        width: calc(100% - 10px);
        height: 48px;
        min-height: 48px;

        padding: 0 12px;
        margin: 5px auto;

        justify-content: flex-start;
        gap: 10px;
    }

    /* texto aparece quando aberta */
    .sidebar .menu-item span {
        display: inline;
    }

    /* ícones */
    .sidebar-icon {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
        margin: 0;
    }


    /* sidebar FECHADA */

    .sidebar.collapsed .menu-item {
        width: 48px;
        height: 48px;
        min-height: 48px;

        padding: 0;
        margin: 5px auto;

        justify-content: center;
    }

    /* esconde texto somente quando fechada */
    .sidebar.collapsed .menu-item span {
        display: none;
    }


    /* ===== CONTEÚDO ===== */

    .content-area {
        flex: 1;
        min-width: 0;
        width: auto;
        left: auto;
    }

    .content-frame {
        width: 100%;
        height: 100%;
        border: 0;
    }

   
}