/* ============================================================================
   app.css — ULTRADATA
   rivaesse.nucleobase.deepseek.terra.17092026EC
   ============================================================================ */

   :root {
    --bg: #2A3B4C;
    --bg-dark: #1f2a36;
    --bg-darker: #0f151c;
    --green: #7ED957;
    --blue: #1A56DB;
    --cyan: #5CE1E6;
    --white: #FFFFFF;
    --muted: #888;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    font-family: 'Inter', 'Ubuntu', sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    align-items: center;
    min-height: 100vh;
    color: var(--white);
    overflow-x: clip;
}

.container {
    text-align: center;
    max-width: 1400px;
    width: 95%;
    padding: 20px;
    box-sizing: border-box;
    flex: 1;
}

.brand {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -1px;
}
.brand span.green { color: var(--green); }
.brand span.blue { color: var(--blue); }

/* ============================================================================
   LOGIN
   ============================================================================ */
#login-screen {
    background-color: var(--bg) !important;
    min-height: 100vh !important;
    width: 100vw !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
#login-screen .handshake-img {
    display: block;
    margin: 15px auto;
    max-width: 75%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* ============================================================================
   MENU
   ============================================================================ */
#menu-screen { display: none; padding: 10px; width: 100%; max-width: 900px; box-sizing: border-box; flex: 1; min-height: 0; overflow-y: auto; }
.user-welcome { margin-bottom: 15px; opacity: 0.8; font-size: 1.1rem; }

.grid-2x5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin: 20px 0;
}
.grid-item {
    background: var(--green);
    color: #1A1A1A;
    padding: 15px 5px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.2;
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.grid-item:hover { transform: translateY(-4px); background: var(--cyan); }

.menu-section { width: 100%; margin-bottom: 30px; }
.menu-section-title {
    text-align: left;
    margin-bottom: 15px;
    padding-left: 10px;
    font-size: 1.1rem;
    color: var(--cyan);
    border-left: 4px solid var(--cyan);
    font-weight: bold;
    letter-spacing: 1px;
    opacity: 0.9;
}

.grid-2x6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin: 20px 0;
}

@media (max-width: 900px) {
    .grid-2x6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .grid-2x6 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
   ÁREA DE CONTEÚDO
   ============================================================================ */
#content-area {
    display: none;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px 20px 20px;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 90vh;
}

.btn-voltar {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid var(--cyan);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 15px;
    font-family: inherit;
    transition: 0.2s;
}
.btn-voltar:hover { background: var(--cyan); color: #1A1A1A; }

/* ============================================================================
   COMPONENTES — LEITOR E MURAL
   ============================================================================ */
.leitor-bloco {
    background: #1f2a36;
    padding: 12px 16px;
    border-left: 6px solid var(--cyan);
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}
.leitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: #aaa;
}
.leitor-conteudo {
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    color: #ddd;
    border-top: 1px solid #333;
    padding-top: 8px;
}
.mural-card {
    background: #1f2a36;
    border-radius: 12px;
    padding: 12px 16px;
    color: #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    min-height: 80px;
    text-align: left;
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 10px;
    border-left: 6px solid var(--green);
}

/* ============================================================================
   OFICINAS — CONTAINER E PAINÉIS
   ============================================================================ */
.oficina-container {
    display: flex;
    gap: 15px;
    width: 100%;
    flex: 1;
    min-height: 70vh;
    max-height: 85vh;
    background: rgba(0,0,0,0.15);
    padding: 15px;
    border-radius: 12px;
    box-sizing: border-box;
    overflow: hidden;
}
.oficina-panel {
    background: #1f2a36;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    color: var(--white);
    overflow: hidden;
}
.oficina-left { width: 240px; flex-shrink: 0; }
.oficina-center { flex: 1; }
.oficina-right { flex: 2; }

.panel-title {
    font-size: 0.8rem;
    color: var(--cyan);
    margin-bottom: 12px;
    opacity: 0.8;
    font-weight: bold;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* ============================================================================
   ESTANTE (oficinas de texto)
   ============================================================================ */
.estante-area { flex: 1; overflow-y: auto; margin-bottom: 10px; }
.estante-item {
    font-size: 0.85rem;
    color: #aaa;
    padding: 8px 0;
    border-bottom: 1px solid #2A3B4C;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.estante-item span { flex: 1; word-break: break-word; white-space: normal; line-height: 1.4; }
.estante-item:hover { color: var(--green); background: #2A3B4C; padding-left: 8px; border-radius: 4px; }
.estante-item .btn-excluir {
    flex-shrink: 0;
    background: #d9534f;
    border: none;
    color: white;
    padding: 0px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0.6;
    transition: 0.2s;
    margin-left: 8px;
}
.estante-item .btn-excluir:hover { opacity: 1; background: #c9302c; }

.leitor-area {
    flex: 1;
    background: #2A3B4C;
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #ddd;
    border-left: 4px solid var(--green);
    max-height: 65vh;
}
.editor-area {
    flex: 1;
    background: #2A3B4C;
    border-radius: 4px;
    border: none;
    padding: 15px;
    color: var(--white);
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    max-height: 65vh;
    overflow-y: auto;
}
.editor-area::placeholder { color: #666; }

/* ============================================================================
   BOTÕES DE OFICINA
   ============================================================================ */
.btn-oficina {
    background: var(--green);
    color: #1A1A1A;
    border: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 5px;
}
.btn-oficina:hover { background: var(--cyan); }
.btn-oficina-secondary {
    background: transparent;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 6px 12px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    margin-top: 5px;
    margin-left: 5px;
}
.btn-oficina-secondary:hover { background: rgba(92, 225, 230, 0.1); }

/* ============================================================================
   MODAIS GENÉRICOS
   ============================================================================ */
.modal-title-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.75);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
}
.modal-title-box {
    background: #2A3B4C;
    padding: 30px;
    border-radius: 16px;
    border: 2px solid var(--cyan);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    width: 400px;
    max-width: 90%;
    text-align: center;
}
.modal-title-box h3 { color: var(--cyan); margin-top: 0; }
.modal-title-box input {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid #444;
    background: #1f2a36;
    color: white;
    font-family: inherit;
    box-sizing: border-box;
    font-size: 1rem;
}
.btn-modal-confirm {
    background: var(--green);
    color: #1A1A1A;
    border: none;
    padding: 8px 24px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
}
.btn-modal-cancel {
    background: transparent;
    color: #888;
    border: 1px solid #888;
    padding: 8px 24px;
    border-radius: 12px;
    margin-left: 10px;
    cursor: pointer;
}

.modal-lista {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}
.modal-transcription {
    position: fixed;
    top:0; left:0;
    width:100%; height:100%;
    background: rgba(0,0,0,0.8);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
}
.transcription-box {
    background: #1f2a36;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--cyan);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.transcription-textarea {
    flex: 1;
    min-height: 200px;
    background: #2A3B4C;
    border: 1px solid #444;
    color: white;
    font-family: monospace;
    padding: 10px;
    border-radius: 4px;
    resize: vertical;
}
.transcription-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

.modal-busca {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}
.modal-progresso {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}
.modal-composicao {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 100000;
    justify-content: center;
    align-items: center;
}
.modal-comentario {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 100001;
    justify-content: center;
    align-items: center;
}
.modal-config-bling {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 100002;
    justify-content: center;
    align-items: center;
}
.modal-detalhe-produto {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 100150;
    justify-content: center;
    align-items: center;
}

/* ============================================================================
   CENÁCULO
   ============================================================================ */
.cenaculo-container { display: flex; gap: 20px; width: 100%; min-height: 500px; }
.cenaculo-side {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 100px;
    gap: 10px;
}
.cenaculo-center { flex: 1; display: flex; flex-direction: column; gap: 15px; }
.mirror-avatar {
    width: 80px;
    height: 80px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #1A1A1A;
    font-weight: bold;
    font-size: 0.7rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    text-align: center;
    padding: 5px;
    line-height: 1.1;
    transition: 0.2s;
}
.mirror-avatar:hover { transform: scale(1.05); background: var(--blue); color: var(--white); }

/* ============================================================================
   INSPIRAÇÃO (videoteca)
   ============================================================================ */
.inspiracao-container {
    display: flex;
    gap: 20px;
    width: 100%;
    min-height: 70vh;
    max-height: 80vh;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto;
}
.inspiracao-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}
.inspiracao-player {
    flex: 1;
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}
.video-card {
    background: #1f2a36;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid var(--cyan);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.video-card:hover { background: #2A3B4C; border-left-color: var(--green); }
.video-title { font-weight: bold; font-size: 0.85rem; color: var(--white); }
.video-meta { font-size: 0.7rem; color: #888; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { background: #2A3B4C; color: var(--cyan); padding: 0px 6px; border-radius: 4px; font-size: 0.65rem; }

/* ============================================================================
   LEDGER
   ============================================================================ */
.ledger-container {
    display: flex;
    gap: 20px;
    width: 100%;
    min-height: 75vh;
    max-height: 80vh;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto;
}
.ledger-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}
.ledger-mural {
    flex: 1;
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ============================================================================
   ESTOQUISTA — GRID DE CONFIG
   ============================================================================ */
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.campo-config { color: #aaa; font-size: 0.8rem; display: flex; align-items: center; gap: 5px; }

.log-uploads-content { font-size: 0.95rem; color: #ddd; line-height: 1.6; }
.log-uploads-content strong { font-size: 1rem; }

/* ============================================================================
   FOOTER
   ============================================================================ */

   footer {
    width: 100%;
    padding: 30px 0 50px 0;   /* bottom: 100px → 50px */
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    background-color: var(--bg);
    flex-shrink: 0;
    position: relative;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.footer-urls {
    font-size: 0.95rem;
}

.footer-urls span {
    color: var(--cyan);
}

.footer-whale {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    color: var(--blue);
}

.footer-whale svg {
    fill: var(--blue);
    width: 26px;
    height: 26px;
}

#dip-laptop-avatar {
    position: fixed;
    bottom: 20px;
    right: 24px;
    z-index: 99999;   /* era 9998 */
    width: 56px;
    height: 56px;
    background: var(--blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(26, 86, 219, 0.5);
    cursor: pointer;
    border: 2px solid var(--cyan);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse-avatar 2s infinite;
}

#dip-laptop-avatar svg {
    width: 32px;
    height: 32px;
    fill: var(--white);
}

#dip-laptop-speech {
    position: fixed;
    bottom: 90px;
    right: 100px;
    z-index: 99999;
    background: #1f2a36;
    border: 1px solid var(--cyan);
    border-radius: 8px;
    padding: 10px 15px;
    max-width: 250px;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    font-size: 0.8rem;
    line-height: 1.4;
    color: #ddd;
}
#dip-laptop-speech::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--cyan) transparent transparent transparent;
}

/* ============================================================================
   RESPONSIVO
   ============================================================================ */
@media (max-width: 768px) {
    .grid-2x5 { grid-template-columns: repeat(2, 1fr); }
    .cenaculo-container { flex-direction: column; align-items: center; }
    .cenaculo-side { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .mirror-avatar { width: 60px; height: 60px; }
    .oficina-container { flex-direction: column; }
    .oficina-left { width: 100%; }
    .oficina-right { min-height: 250px; }
    #dip-laptop-avatar { bottom: 15px; right: 15px; width: 48px; height: 48px; }
    #dip-laptop-avatar svg { width: 26px; height: 26px; }
    #dip-laptop-speech { right: 70px; max-width: 150px; }
    footer { font-size: 1rem; padding-bottom: 80px; }
    .ledger-container, .inspiracao-container { flex-direction: column; }
    .ledger-sidebar, .inspiracao-sidebar { width: 100%; }
}
/* ============================================================================
   MOBILE POLISH (Ajustes para LG K40S e iPhone)
   ============================================================================ */
@media (max-width: 768px) {
    /* 1. Previne o pulo do layout quando a barra de endereço some */
    body, html {
        height: 100dvh !important;
        overflow: hidden !important;
    }

    /* 2. Esconde barras de rolagem feias no chat */
    ::-webkit-scrollbar {
        width: 0px;
        background: transparent;
    }

    /* 3. Ajuste da Bolota Central na Tela Inicial */
    .bolota-central {
        width: 140px !important;
        height: 140px !important;
    }

    /* 4. Ajuste do Container do App */
    #app-container {
        height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    /* 5. Área de conteúdo principal */
    #content-area {
        flex: 1;
        overflow-y: auto;
        padding-bottom: env(safe-area-inset-bottom, 20px) !important;
    }

    /* 6. Aumento das áreas de toque (Touch Targets) */
    .grid-item, .btn-oficina, .btn-oficina-secondary, .btn-voltar {
        min-height: 44px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 7. O Chat no celular */
    .dip-chat-container {
        height: calc(100dvh - 150px) !important; /* Ocupa o espaço restante */
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        z-index: 10000;
    }

    /* 8. O input do chat não pode ser esmagado */
    #dip-dash-input, #dip-input {
        font-size: 16px !important; /* Evita o zoom automático no iOS */
    }
}

/* ============================================================================
   MOBILE POLISH V2 (Ajustes finos para o protótipo LG K40S)
   ============================================================================ */
@media (max-width: 768px) {
    body, html {
        height: 100dvh !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Esconde a barra de rolagem feia */
    ::-webkit-scrollbar { width: 0px; background: transparent; }

    /* Ajuste do container */
    /* Correção de Fluxo do Rodapé e Rolagem */
    body, html {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    
    #app-container, #content-area {
        min-height: calc(100dvh - 120px) !important; /* Reserva espaço para o rodapé */
        padding-bottom: 80px !important; /* Espaço para a bolota não cobrir o conteúdo */
    }

    footer {
        display: flex !important;
        padding-bottom: 30px !important;
        position: relative !important;
    }

    /* O MENU: Mantém as 2 colunas, mas ajusta o tamanho dos botões */
    .grid-2x6, .grid-2x5 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; 
        gap: 8px !important;
    }
    .grid-item {
        min-height: 50px !important;
        padding: 8px !important;
        font-size: 0.75rem !important;
    }

    /* O CHAT: Ocupa a tela toda no celular */
    #dip-chat-panel {
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        z-index: 100000 !important;
        transition: height 0.1s ease-out;
    }

    /* Fix do teclado */
    input, select, textarea { font-size: 16px !important; }

    /* Tabelas (Estoquista, CRM) rolam pro lado em vez de quebrar */
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
}

/* Fix definitivo para o teclado no mobile */
@media (max-width: 768px) {
    #dip-chat-panel {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        border-radius: 0 !important;
        transition: height 0.1s ease-out; /* Suaviza a subida */
    }
    
    /* Impede que a página inteira role quando o teclado abrir */
    body:has(#dip-chat-panel[style*="display: flex"]) {
        overflow: hidden !important;
    }
}




/* Responsividade Mobile (LG K40S) */
@media (max-width: 768px) {
    .footer-padrao {
        gap: 12px 20px;
    }
    .footer-logos-wrap img {
        height: 32px; /* Ajuste sutil para telas pequenas */
    }
    .footer-url-pill {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    .footer-text-sub {
        font-size: 0.65rem;
    }
}




@media (max-width: 768px) {
    .footer-oficial { gap: 10px; }
    .footer-oficial-logos img { height: 34px; } /* Ajuste mobile */
    .footer-pill-oficial { font-size: 0.65rem; padding: 6px 10px; }
    .footer-sub-oficial { font-size: 0.6rem; }
}




@media (max-width: 768px) {
    .footer-oficial { gap: 10px; }
    .footer-oficial-logos img { height: 34px; } /* Ajuste mobile */
    .footer-pill-oficial { font-size: 0.65rem; padding: 6px 10px; }
    .footer-sub-oficial { font-size: 0.6rem; }
}



    .footer-ultradata .logos img { height: 32px; }
    .footer-ultradata .urls { gap: 15px; font-size: 0.8rem; }
}


/* ============================================================================
   RODAPÉ PERFEITO (Logos Equalizadas + URLs Legíveis)
   ============================================================================ */
.footer-ultradata {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px 20px;
    margin-top: auto; /* Empurra o footer pro final da página */
    border-top: 1px solid rgba(255,255,255,0.05);
    width: 100%;
    box-sizing: border-box;
}

/* Proporção: DeepSeek 20% maior que a base */
.footer-ultradata .logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-ultradata .logos .brand-text {
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: -0.5px;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 38px; /* Altura de referência */
}

.footer-ultradata .logos .plus {
    color: #666;
    font-size: 1.4rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    height: 38px;
}

.footer-ultradata .logos img {
    height: 56px; /* Aumentado +20% sobre 46px */
    width: auto;
    object-fit: contain;
    opacity: 0.9;
    display: block;
    /* O align-items: center do container pai já garante o alinhamento vertical */
}

/* URLs lado a lado, sem ícones, com contraste */
.footer-ultradata .urls {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-ultradata .urls a {
    color: var(--cyan);
    text-decoration: none;
    transition: 0.2s;
}

.footer-ultradata .urls a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(92,225,230,0.5);
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .footer-ultradata .logos .brand-text, .footer-ultradata .logos .plus { height: 32px; }
    .footer-ultradata .logos .brand-text { font-size: 1.3rem; }
    .footer-ultradata .logos img { height: 46px; }
    .footer-ultradata .logos .plus { font-size: 1.2rem; }
    .footer-ultradata .urls { gap: 15px; font-size: 0.75rem; }
}

/* Correção do corte do menu (Scroll Global) */
body, html {
    height: 100%;
    overflow-y: auto;
}
#app-container, #content-area {
    min-height: calc(100vh - 120px); /* Desconta o footer */
    padding-bottom: 20px;
}

/* ============================================================================
   CORREÇÃO MOBILE DEFINITIVA (Módulos Internos)
   ============================================================================ */
@media (max-width: 768px) {

    /* 1. Tabelas: Rolagem horizontal em vez de esmagamento */
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }
    th, td {
        padding: 10px 8px !important;
        font-size: 0.8rem !important;
    }

    /* 2. PDV: Empilha a busca e o carrinho */
    .pdv-grid, div[style*="grid-template-columns:1.4fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }
    /* O carrinho fica abaixo dos produtos */
    .pdv-carrinho { min-height: 300px; }

    /* 3. Vinci (Artista): Modal empilhado (Preview em cima, Controles embaixo) */
    .vinci-modal-grid {
        grid-template-columns: 1fr !important;
        overflow-y: auto !important;
        height: auto !important;
    }
    .vinci-modal-grid > div:first-child {
        min-height: 300px; /* Garante que o preview apareça */
    }

    /* 4. Modais Genéricos: Tela cheia no celular */
    .mc-modal-box, 
    .modal-lista > div, 
    .modal-composicao > div,
    div[style*="width:1100px"],
    div[style*="width:900px"] {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
    }

    /* 5. Botões e Inputs: Área de toque confortável */
    input, select, textarea {
        font-size: 16px !important; /* Evita zoom no iOS */
        padding: 12px !important;
    }
    button, .btn-oficina, .btn-oficina-secondary, .btn-voltar {
        min-height: 44px !important; /* Padrão Apple/Google */
        font-size: 0.9rem !important;
    }

    /* 6. O Chat da Bolota: Ocupa a tela toda no mobile */
    #dip-chat-panel {
        width: 100vw !important;
        height: 100dvh !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        border: none !important;
    }
}
