:root {
    --azul-lac: #536eb5;      
    --azul-claro: #eef3ff;    
    --borda: #d1d9e6;         
    --branco: #ffffff;
    --texto: #333333;
    --cyan-ia: #00d9ff;
    --verde-online: #00ff88;
}

/* 1. RESET E ESTRUTURA BASE */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--texto);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- 2. NAV TOPO (TELEMETRIA) --- */
.telemetria-nav {
    background: #ffffff;
    padding: 15px 0;
    border-bottom: 2px solid var(--azul-lac);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap; /* Ajuste para não quebrar em telas médias */
}

.nav-item {
    font-size: 0.75rem;
    font-weight: 800;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- 3. LOGIN BOX --- */
.main-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.logo h1 { 
    font-size: 2.5rem; 
    background: linear-gradient(90deg, var(--azul-lac), var(--cyan-ia));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
}

.input-group { text-align: left; margin-bottom: 15px; }
.input-group label { font-size: 0.65rem; font-weight: bold; color: var(--azul-lac); display: block; margin-bottom: 5px; }
input { width: 100%; padding: 14px; background: var(--azul-claro); border: 1px solid var(--borda); border-radius: 8px; font-size: 16px; }
input:focus { outline: none; border-color: var(--cyan-ia); background: #fff; box-shadow: 0 0 10px rgba(0, 217, 255, 0.1); }

.btn-login { width: 100%; padding: 15px; background: var(--azul-lac); color: white; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-login:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* --- 4. FOOTER HOSPITALAR (RESTAURADO) --- */
.footer-hospitalar {
    background-color: var(--azul-lac) !important;
    color: white !important;
    padding: 40px 20px !important;
    width: 100% !important;
    margin-top: auto;
}

.footer-main-grid {
    display: flex !important;
    justify-content: space-between !important;
    max-width: 1400px !important;
    margin: 0 auto;
    gap: 30px !important;
    flex-wrap: wrap !important; /* Adicionado para responsividade */
}

.footer-column {
    flex: 1 1 250px; /* Base de 250px para permitir quebra de linha */
    display: flex;
    flex-direction: column;
    gap: 10px !important;
    min-width: 200px;
}

.footer-column h3 {
    margin-bottom: 12px !important; 
    font-size: 0.65rem;
    color: #00d9ff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
    text-transform: uppercase;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 !important;
    font-size: 0.65rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-item strong {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 35px;
    text-align: center;
}

.online-status-bar { display: flex; justify-content: center; margin: 30px 0; }
.pill-online {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--verde-online);
    padding: 12px 40px;
    border-radius: 50px;
    color: var(--verde-online);
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.logo-footer { height: 25px; filter: brightness(0) invert(1); opacity: 0.7; }

#core-ia-floater {
    position: fixed !important;
    bottom: 250px; /* Subimos mais para garantir que saia do rodapé */
    right: 40px;
    width: 80px;
    height: 80px;
    z-index: 10001;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* O console (painel de mensagens) precisa subir junto */
#ia-console-panel {
    position: fixed !important;
    bottom: 340px; /* Sobe para ficar logo acima da orbe */
    right: 40px;
    width: 300px;
    height: 400px;
    z-index: 10000;
}

/* Ajuste do console para ele subir junto com a orbe */
#ia-console-panel {
    position: fixed !important;
    bottom: 270px; /* Sobe para ficar acima da orbe */
    right: 40px;
    width: 300px;
    height: 400px;
    z-index: 10000;
}

.ia-core-eye {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, #00f2ff 50%, #0066ff 100%);
    box-shadow: 0 0 20px #00f2ff;
    z-index: 2;
}

.ia-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px dashed #00f2ff;
    border-radius: 50%;
    animation: rotate-ia 4s linear infinite;
    opacity: 0.5;
}

.ia-status-tag {
    position: absolute;
    top: -25px;
    background: #00f2ff;
    color: #000;
    font-size: 0.5rem;
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 900;
    box-shadow: 0 0 10px #00f2ff;
}

#ia-console-panel {
    position: fixed !important;
    bottom: 120px;
    right: 30px;
    width: 300px;
    height: 400px;
    background: rgba(10, 14, 23, 0.95);
    border: 1px solid #00f2ff;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.console-header { background: #00f2ff; color: #000; padding: 10px; font-size: 0.6rem; font-weight: bold; }
#console-messages { flex: 1; padding: 15px; font-family: 'Courier New', monospace; font-size: 0.7rem; color: #00f2ff; overflow-y: auto; }

/* --- 6. ELEMENTOS E ANIMAÇÕES --- */
.dot { height: 10px; width: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.green-pulse { background: var(--verde-online); animation: pulse-green 2s infinite; }
.red { background: #ff0044; box-shadow: 0 0 8px #ff0044; }
.blue { background: var(--cyan-ia); }
.pink { background: #ff69b4; }
.white { background: #fff; border: 1px solid #ccc; }
.cyan-glow { background: #00f2ff; box-shadow: 0 0 12px #00f2ff; animation: pulse-blue 2s infinite; }

.hidden { display: none !important; }

@keyframes rotate-ia { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); } }
@keyframes pulse-blue { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- 7. REGRAS DE RESPONSIVIDADE (NOVAS) --- */

/* TVs e Monitores Grandes */
@media (min-width: 1600px) {
    .footer-main-grid { max-width: 1600px !important; gap: 60px !important; }
    .status-item { font-size: 0.75rem !important; }
}

/* Notebooks e Tablets Paisagem */
@media (max-width: 1200px) {
    .footer-main-grid { justify-content: center !important; gap: 40px !important; }
}

/* Tablets Retrato */
@media (max-width: 900px) {
    .footer-main-grid { gap: 20px !important; }
    .footer-column { flex: 1 1 40%; } /* Ficam 2 colunas por linha */
    .nav-container { gap: 20px; }
}

/* Celulares */
@media (max-width: 600px) {
    .telemetria-nav { padding: 10px 0; }
    .nav-container { flex-direction: column; gap: 8px; }
    .nav-item { font-size: 0.65rem; }
    
    .login-box { padding: 30px 20px; border-radius: 20px; }
    .logo h1 { font-size: 1.8rem; }
    
    .footer-main-grid { flex-direction: column !important; align-items: center !important; }
    .footer-column { width: 100% !important; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; }
    .status-item { justify-content: space-around; }

    #core-ia-floater { width: 60px; height: 60px; bottom: 15px; right: 15px; }
    #ia-console-panel { width: 90%; right: 5%; bottom: 85px; height: 350px; }
}
/* --- AJUSTE FINAL: EQUILÍBRIO TOTAL E IA COM RESPIRO (CELULAR) --- */
@media (max-width: 600px) {
    
    .footer-hospitalar {
        padding: 40px 15px !important; /* Mais espaço interno no footer */
    }

    .footer-main-grid {
        display: flex !important;
        flex-direction: column !important;
        /* Espaço para a IA à direita e margem na esquerda */
        padding-left: 5px !important;
        padding-right: 60px !important; 
        gap: 40px !important; /* Aumentei o espaço entre os blocos (Unidades, Equipe, etc) */
        width: 100% !important;
    }

    .footer-column h3 {
        font-size: 0.8rem !important;
        margin-bottom: 15px !important;
        letter-spacing: 1px;
    }

    .status-item {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important; /* Mais altura em cada linha para facilitar o toque */
        font-size: 0.75rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    .status-item strong {
        min-width: 35px;
        text-align: center;
        background: rgba(0, 217, 255, 0.1); /* Um leve toque de ciano no fundo do número */
        color: #00f2ff;
        padding: 3px 6px;
        border-radius: 4px;
        flex-shrink: 0;
    }

    /* LAC SYSTEM COM ESPAÇO PARA BRILHAR */
    #core-ia-floater {
        position: fixed !important;
        bottom: 30px !important; 
        right: 15px !important; /* Descolei da borda extrema */
        left: auto !important;
        transform: none !important;
        width: 70px !important; /* Tamanho ideal para não tampar texto */
        height: 70px !important;
        z-index: 10005;
        filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.4)); /* Reforça o brilho */
    }

    #ia-console-panel {
        width: 92% !important;
        right: 4% !important;
        bottom: 110px !important;
        height: 350px !important;
    }
}