/* --- Tema SaaS Moderno (Blokio Control System) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #2d3748;
    min-height: 100vh;
    overflow-y: auto;
}

.oculto {
    display: none !important;
}

/* ==========================================
   TELAS DE AUTENTICAÇÃO (BLOKIO)
   ========================================== */
.auth-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #283c4a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.auth-box {
    display: flex;
    width: 100%;
    max-width: 950px;
    min-height: 500px;
    max-height: 95vh;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    background-color: #ffffff;
}

.auth-left {
    flex: 1.1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0c1a27;
}

.login-bg {
    background-image: url('Imagens/logo-login.png');
}

.cad-bg {
    background-image: url('Imagens/Cadastro.png');
}

.auth-right {
    flex: 0.9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 40px;
    background-color: #ffffff;
    overflow-y: auto;
}

.auth-right::-webkit-scrollbar {
    width: 6px;
}

.auth-right::-webkit-scrollbar-track {
    background: transparent;
}

.auth-right::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.auth-logo-img {
    max-width: 170px;
    margin: 0 auto 25px auto;
    display: block;
}

.auth-titulo-cad {
    color: #1a202c;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 15px;
}

.input-auth {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    border: 1px solid #cbd5e0;
    background-color: #ffffff;
    color: #2d3748;
    transition: 0.2s;
}

.input-auth::placeholder {
    color: #a0aec0;
    font-weight: 500;
}

.input-auth:focus {
    border-color: #1353a1;
    box-shadow: 0 0 0 3px rgba(19, 83, 161, 0.1);
}

.input-icon-wrapper {
    position: relative;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 13px;
    color: #a0aec0;
    cursor: pointer;
    font-size: 20px;
}

.auth-opcoes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 12px;
    color: #4a5568;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.link-auth {
    color: #4a5568;
    text-decoration: none;
    font-weight: 700;
}

.link-auth:hover {
    color: #1353a1;
    text-decoration: underline;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
}

.btn-blokio {
    background-color: #0d2746;
    color: white;
}

.btn-blokio:hover {
    background-color: #173b63;
    transform: translateY(-1px);
}

.auth-divisor {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divisor::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

.auth-divisor span {
    background: #ffffff;
    padding: 0 15px;
    color: #a0aec0;
    font-size: 12px;
    position: relative;
    z-index: 2;
    font-weight: 500;
}

.btn-google-outline {
    background-color: #ffffff;
    border: 1px solid #cbd5e0;
    max-width: 150px;
    margin: 0 auto;
    padding: 10px;
}

.btn-google-outline:hover {
    background-color: #f8fafc;
    border-color: #a0aec0;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
}

.auth-footer a {
    color: #1353a1;
    text-decoration: none;
    font-weight: 700;
    margin-left: 5px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.regras-senha-blokio {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: -5px;
    margin-bottom: 15px;
}

.radio-regra {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #a0aec0;
}

.radio-regra input[type="radio"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #cbd5e0;
    background-color: #edf2f7;
}

.btn-principal {
    background-color: #0d2746 !important;
}

.btn-principal:hover {
    background-color: #173b63 !important;
}

.prod-icon-box,
.icone-total {
    background-color: #ebf8ff !important;
    color: #1353a1 !important;
}

/* ==========================================
   DASHBOARD SAAS
   ========================================== */
#tela-pastas {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* --- SIDEBAR LATERAL --- */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    border-right: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
    padding: 0 0 20px 0;
    z-index: 10;
    overflow-y: auto;
    position: relative;
    /* Necessário para o botão flutuante */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    /* Animação suave */
}

.menu-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #a0aec0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 15px 30px 10px 30px;
    transition: opacity 0.2s;
}

.menu-navegacao {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 15px;
    flex-shrink: 0;
}

.btn-menu {
    background: transparent;
    border: none;
    text-align: left;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-menu .material-symbols-rounded {
    font-size: 22px;
    color: #4a5568;
}

.btn-menu:hover {
    background-color: #f7fafc;
    color: #2d3748;
}

.btn-menu:hover .material-symbols-rounded {
    color: #2d3748;
}

.btn-menu.ativo {
    background-color: #f0f5f9;
    color: #2d3748;
    font-weight: 600;
}

.btn-menu.ativo .material-symbols-rounded {
    color: #1353a1;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 25px;
    border-top: 1px solid #edf2f7;
    flex-shrink: 0;
}

.pwa-install-button {
    margin: auto 15px 0 15px;
    padding: 12px 15px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1353a1;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
}

.pwa-install-button:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.pwa-install-button .material-symbols-rounded {
    font-size: 21px;
}

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

.avatar {
    background: #ffedd5;
    color: #dd6b20;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #2d3748;
}

/* --- ÁREA PRINCIPAL (CENTRO) --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 50px;
    background-color: #f8fafc;
}

.aba-conteudo {
    display: none;
    animation: fadeIn 0.3s ease;
}

.aba-conteudo.ativa {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ESTILOS GERAIS DE BOTÕES */
.titulo-secao {
    font-size: 20px;
    color: #2d3748;
    margin-bottom: 20px;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 12px;
    font-weight: 700;
}

.btn-principal {
    background-color: #0d2746 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(13, 39, 70, 0.2);
}

.btn-principal:hover {
    background-color: #173b63 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(13, 39, 70, 0.3);
}

.btn-secundario {
    background: transparent;
    border: 1px solid #cbd5e0;
    color: #4a5568;
    padding: 11px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secundario:hover {
    border-color: #a0aec0;
    color: #2d3748;
    background-color: #f7fafc;
}

/* ==========================================
   TELA DE BIPAGEM
   ========================================== */
.app-container {
    background: #ffffff;
    width: 100%;
    max-width: 1100px;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 40px 50px;
    margin: 40px auto;
    align-self: flex-start;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.progresso-container {
    background: #f0fdf4;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #bbf7d0;
}

.area-leitor {
    background: #f8fafc;
    padding: 35px;
    border-radius: 16px;
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;
}

.area-leitor input {
    width: 100%;
    padding: 22px;
    font-size: 22px;
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s;
    text-align: center;
    color: #1a202c;
}

.area-leitor input:focus {
    border-color: #1353a1;
    box-shadow: 0 0 0 4px rgba(19, 83, 161, 0.15);
}

.status {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

/* ==========================================
   CARTÕES (COMPRAS FORNECEDORES E BIPAGEM)
   ========================================== */
.grid-itens {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.card-item {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s;
    position: relative;
}

.card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e0;
}

.card-bipagem {
    border-left: 6px solid #a0aec0;
    flex-direction: row;
    align-items: center;
}

.info-card .codigo {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 800;
    color: #1e3a28;
    display: block;
    margin-bottom: 10px;
    word-break: break-all;
}

.info-card .data {
    font-size: 14px;
    color: #718096;
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.btn-apagar {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #fed7d7;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}

.card-vencido {
    border-left: 6px solid #e53e3e !important;
    background-color: #fff5f5 !important;
    border-color: #fed7d7 !important;
}

.card-vence-ano {
    border-left: 6px solid #d97706 !important;
    background-color: #fffaf0 !important;
    border-color: #feebc8 !important;
}

/* PESQUISA E MODAIS */
.input-pesquisa {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
    background-color: #ffffff;
}

.input-pesquisa:focus {
    border-color: #1353a1;
    box-shadow: 0 0 0 3px rgba(19, 83, 161, 0.1);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.input-modal {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: 0.3s;
    background: #f8fafc;
}

.input-modal:focus {
    border-color: #1353a1;
    background: #ffffff;
}

/* ==========================================
   ESTILOS EXCLUSIVOS DA ABA DE PERFIL
   ========================================== */
.input-perfil {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
    background-color: #ffffff;
    outline: none;
}

.box-info {
    background-color: #edf2f7;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
}

.box-info.status-green {
    background-color: #f0fdf4;
    color: #10b981;
    font-weight: 600;
}

#btn-sair:hover {
    background-color: #fff0f0 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(229, 62, 62, 0.1);
}

/* ==========================================
   TABELAS PADRÃO (PRODUTOS E VALIDADES)
   ========================================== */
.tabela-container {
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.tabela-header {
    display: flex;
    padding: 15px 20px;
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
    font-size: 11px;
    font-weight: 800;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* PRODUTOS */
.card-total-produtos {
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    min-width: 250px;
    justify-content: space-between;
}

.titulo-total {
    font-size: 12px;
    color: #a0aec0;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.valor-total {
    font-size: 28px;
    font-weight: 800;
    color: #1a202c;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 20px;
}

.input-pesquisa-header {
    padding: 12px 15px 12px 45px;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    font-size: 14px;
    width: 300px;
    outline: none;
    transition: 0.2s;
    color: #2d3748;
    background: #ffffff;
}

.input-pesquisa-header:focus {
    border-color: #1353a1;
    box-shadow: 0 0 0 3px rgba(19, 83, 161, 0.1);
}

.btn-importar {
    border: 1px solid #cbd5e0;
    background: white;
    color: #4a5568;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    margin: 0;
}

.btn-importar:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

.btn-adicionar {
    background: #0d2746;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    margin: 0;
}

.btn-adicionar:hover {
    background: #173b63;
}

.linha-produto {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #edf2f7;
    align-items: center;
    transition: 0.2s;
}

.linha-produto:hover {
    background: #f8fafc;
}

.linha-produto:last-child {
    border-bottom: none;
}

.acao-icon {
    color: #a0aec0;
    cursor: pointer;
    transition: 0.2s;
    font-size: 20px;
}

.acao-icon:hover {
    color: #2d3748;
}

.acao-icon.delete:hover {
    color: #e53e3e;
}

/* VALIDADES */
.card-estatistica {
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    min-width: 250px;
    flex: 1;
    max-width: 320px;
}

.estatistica-icone {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
}

.icone-alerta {
    background: #fff5f5;
    color: #e53e3e;
}

.icone-erro {
    background: #fff5f5;
    color: #e53e3e;
}

.box-relatorio {
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.select-relatorio {
    padding: 12px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    background: white;
    outline: none;
    cursor: pointer;
}

.btn-excel {
    background: #e6fffa;
    color: #047857;
    border: 1px solid #a7f3d0;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-excel:hover {
    background: #d1fae5;
    transform: translateY(-2px);
}

.badge-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    text-align: center;
    min-width: 90px;
}

.badge-vencendo {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.badge-vencido {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #fed7d7;
}

/* OPERAÇÃO (FEED E PASTAS) */
.atividades-recentes-card {
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.scroll-atividades {
    display: flex;
    gap: 25px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-behavior: smooth;
}

.scroll-atividades::-webkit-scrollbar {
    height: 6px;
}

.scroll-atividades::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 10px;
}

.scroll-atividades::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.scroll-atividades::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.atividade-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.atividade-texto {
    font-size: 12px;
    color: #718096;
    line-height: 1.4;
}

.atividade-texto b {
    color: #1a202c;
    font-size: 13px;
    font-weight: 800;
}

.icon-box-orange {
    background: #ffedd5;
    color: #dd6b20;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.icon-box-green {
    background: #d1fae5;
    color: #047857;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.icon-box-purple {
    background: #faf5ff;
    color: #6b46c1;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.icon-box-alert {
    background: #feebc8;
    color: #dd6b20;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.linha-pasta-tabela {
    display: flex;
    padding: 15px 25px;
    border-bottom: 1px solid #edf2f7;
    align-items: center;
    transition: 0.2s;
    cursor: pointer;
}

.linha-pasta-tabela:hover {
    background: #f8fafc;
}

.linha-pasta-tabela:last-child {
    border-bottom: none;
}

.icone-pasta-dinamico {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    flex-shrink: 0;
    transition: 0.2s;
}

.linha-pasta-tabela:hover .icone-pasta-dinamico {
    transform: scale(1.05);
}

.badge-aberta {
    background: #d1fae5;
    color: #047857;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    width: 110px;
    text-align: center;
}

.badge-finalizada {
    background: #fff5f5;
    color: #e53e3e;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    width: 110px;
    text-align: center;
}

/* ==========================================
   RESPONSIVIDADE BLINDADA (TABLET E CELULAR)
   ========================================== */

/* 1. CELULARES (Telas ATÉ 767px - Menu no Topo) */
@media (max-width: 767px) {
    #tela-pastas {
        flex-direction: column !important;
    }

    .sidebar {
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid #edf2f7 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .main-content {
        padding: 20px !important;
    }

    .tabela-header {
        display: none !important;
    }

    .linha-pasta-tabela,
    .linha-produto {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .linha-pasta-tabela>div,
    .linha-produto>div {
        width: 100%;
        text-align: left !important;
        justify-content: flex-start !important;
    }

    /* Esconde o botão de recolher no celular */
    .btn-toggle-sidebar {
        display: none !important;
    }
}

/* 2. TABLETS E PCS (Telas de 768px para cima - Sidebar Fixa na Esquerda) */
@media (min-width: 768px) {
    #tela-pastas {
        flex-direction: row !important;
    }

    .sidebar {
        width: 250px !important;
        /* Tamanho fixo e elegante */
        height: 100vh !important;
        border-right: 1px solid #edf2f7 !important;
        border-bottom: none !important;
        display: flex !important;
        flex-direction: column !important;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .main-content {
        padding: 40px 30px !important;
        /* Ajuste para a tabela caber bem no tablet */
    }
}

/* ==========================================
   ANIMAÇÕES E COMPORTAMENTO DA SIDEBAR RETRÁTIL
   (Sempre no final para garantir prioridade)
   ========================================== */

/* O botão redondo flutuante */
.btn-toggle-sidebar {
    position: absolute;
    right: -15px;
    top: 30px;
    width: 30px;
    height: 30px;
    background-color: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 20;
    transition: transform 0.3s ease;
    color: #4a5568;
    padding: 0;
}

.btn-toggle-sidebar:hover {
    background-color: #f8fafc;
    color: #1353a1;
}

/* CLASSE MÁGICA: QUANDO ESTÁ RECOLHIDA */
.sidebar.recolhida {
    width: 85px !important;
}

.sidebar.recolhida .txt-menu,
.sidebar.recolhida .menu-section-title,
.sidebar.recolhida .pwa-install-text {
    display: none !important;
    /* Esconde os textos */
}

.sidebar.recolhida .btn-menu {
    justify-content: center;
    /* Centraliza os ícones */
    padding: 12px 0;
}

.sidebar.recolhida .pwa-install-button {
    margin-left: 15px;
    margin-right: 15px;
    padding: 12px 0;
}

/* Roda a setinha quando estiver fechada */
.sidebar.recolhida .btn-toggle-sidebar {
    transform: rotate(180deg);
}

/* Troca a logo grande pela pequena */
.sidebar.recolhida .logo-completa {
    display: none !important;
}

.sidebar.recolhida .logo-icone {
    display: block !important;
    margin: 0 auto;
}

/* ==========================================
   🌙 TEMA ESCURO (DARK MODE) E BOTÃO TOGGLE
   ========================================== */

/* 1. Design do Botão Toggle */
.switch-theme {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch-theme input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-theme {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: .4s;
    border-radius: 34px;
}

.slider-theme:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-theme input:checked+.slider-theme {
    background-color: #1353a1;
}

.switch-theme input:checked+.slider-theme:before {
    transform: translateX(22px);
}

/* 2. Regras de Inversão de Cores (Dark Mode) */
body.dark-theme {
    background-color: #0f172a !important;
    /* Fundo geral escuro */
    color: #f1f5f9 !important;
}

/* Sidebar e Containers */
.dark-theme .sidebar,
.dark-theme .auth-right,
.dark-theme .main-content,
.dark-theme .app-container,
.dark-theme .modal-content {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}

/* Caixas brancas e Tabelas */
.dark-theme .tabela-container,
.dark-theme .card-total-produtos,
.dark-theme .card-estatistica,
.dark-theme .box-relatorio,
.dark-theme .atividades-recentes-card,
.dark-theme .card-item,
.dark-theme .area-leitor,
.dark-theme .box-tema-escuro,
.dark-theme div[style*="background-color: #ffffff"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Textos e Títulos */
.dark-theme .titulo-secao,
.dark-theme h1,
.dark-theme h2,
.dark-theme h3,
.dark-theme h4,
.dark-theme .valor-total,
.dark-theme .texto-dinamico,
.dark-theme div[style*="color: #2d3748"] {
    color: #f8fafc !important;
}

.dark-theme div[style*="color: #4a5568"],
.dark-theme p[style*="color: #718096"],
.dark-theme .atividade-texto,
.dark-theme label {
    color: #94a3b8 !important;
}

/* Botões do Menu Lateral */
.dark-theme .btn-menu {
    color: #cbd5e0;
}

.dark-theme .btn-menu:hover {
    background-color: #334155;
}

.dark-theme .btn-menu.ativo {
    background-color: #1353a1;
    color: #ffffff;
}

.dark-theme .pwa-install-button {
    background: rgba(19, 83, 161, 0.18);
    border-color: rgba(96, 165, 250, 0.35);
    color: #bfdbfe;
}

.dark-theme .pwa-install-button:hover {
    background: rgba(19, 83, 161, 0.28);
    border-color: rgba(147, 197, 253, 0.55);
}

/* Cabeçalhos de Tabelas e Linhas */
.dark-theme .tabela-header {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

.dark-theme .linha-produto,
.dark-theme .linha-pasta-tabela {
    border-color: #334155 !important;
}

.dark-theme .linha-produto:hover,
.dark-theme .linha-pasta-tabela:hover {
    background-color: #334155 !important;
}

/* Inputs (Caixas de texto) */
.dark-theme .input-pesquisa-header,
.dark-theme .input-modal,
.dark-theme .input-perfil,
.dark-theme .select-relatorio,
.dark-theme .area-leitor input,
.dark-theme .input-auth {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* Botões Secundários */
.dark-theme .btn-secundario,
.dark-theme .btn-importar {
    border-color: #475569 !important;
    color: #cbd5e0 !important;
}

.dark-theme .btn-secundario:hover,
.dark-theme .btn-importar:hover {
    background-color: #334155 !important;
    color: #f8fafc !important;
    border-color: #64748b !important;
}

/* Ícones dinâmicos nas tabelas */
.dark-theme .prod-icon-box,
.dark-theme .icone-total {
    background-color: #334155 !important;
    color: #60a5fa !important;
}/* ==========================================
   CORREÇÕES DE CONTRASTE (MODAL E CARTÕES DE COMPRA)
   ========================================== */

/* 1. Modal de Detalhes da Compra (Fundo das caixas) */
.dark-theme #modal-compra-conteudo > div {
    background: #1e293b !important; /* Força o fundo a ficar escuro */
    border-color: #334155 !important;
    border-left-color: #475569 !important;
}

/* Garante que os nomes e textos fiquem brancos */
.dark-theme #modal-compra-conteudo b {
    color: #f8fafc !important;
}

/* O vermelho escuro original fica mau no fundo preto, vamos usar um vermelho mais claro (neon) */
.dark-theme #modal-compra-conteudo b[style*="color: #c53030"],
.dark-theme #modal-compra-titulo {
    color: #ef4444 !important; 
}

/* 2. Etiqueta de Total no topo do Modal */
.dark-theme #modal-compra-total {
    background: #450a0a !important; /* Fundo vermelho ultra escuro */
    color: #fca5a5 !important; /* Texto vermelho clarinho */
    border-color: #7f1d1d !important;
}

/* 3. Blocos internos do cartão "Comprar Produto" na tela principal */
.dark-theme .bloco-detalhe {
    background: #0f172a !important;
    border-color: #334155 !important;
}
.dark-theme .bloco-detalhe span[style*="color: #c53030"] {
    color: #ef4444 !important;
}

/* 4. Botão "Ver mais solicitações" */
.dark-theme .btn-expandir-pedidos {
    background: #1e3a8a !important;
    border-color: #2563eb !important;
    color: #bfdbfe !important;
}
