/* =========================================
   1. CORES E TEMA (PREMIUM SAAS)
   ========================================= */
:root {
    --primary-color: #10b981; 
    --dark-solid: #0f172a;    
    --app-bg: #f8fafc;
    --text-muted: #64748b;
    --app-header-h: 75px;
    --app-sidebar-w: 256px;
    /* Verde sólido da marca (cabeçalho / CTAs principais) */
    --brand-green: #047857;
    --brand-green-hover: #065f46;
}

/* === SEM regras de overflow no html/body ===
   O navegador rola naturalmente por padrão.
   Qualquer overflow-y/height aqui CAUSA o bug. */

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--app-bg);
    color: var(--dark-solid);
    min-height: 100vh;
    margin: 0;
}

/* Bootstrap modal: trava scroll enquanto modal aberto */
body.modal-open {
    overflow: hidden !important;
}

/* =========================================
   APP HEADER (MOBILE)
   ========================================= */
.app-header {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 1045 !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    background: linear-gradient(135deg, #047857 0%, #0369a1 100%) !important;
    box-shadow: 0 6px 20px rgba(2, 44, 34, 0.28) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.app-header * {
    background: transparent !important;
}

.app-header-inner {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.3rem 0.5rem;
}

.app-header-logo {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    object-fit: cover;
}

.app-header-title {
    color: #ffffff;
    font-weight: 800;
    font-size: 0.96rem;
    letter-spacing: 0.2px;
    line-height: 1.1;
}

.app-header-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.72rem;
    font-weight: 600;
    display: block;
    line-height: 1.1;
}

.app-credit-pill {
    min-height: 36px;
    min-width: 72px;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.34) !important;
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem !important;
    background: rgba(255, 255, 255, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.app-credit-pill i {
    color: #fde047;
    font-size: 0.9rem;
}

/* Plano corporativo (créditos ilimitados no cliente) */
.app-credit-pill--unlimited {
    background: rgba(16, 185, 129, 0.38) !important;
    border-color: rgba(167, 243, 208, 0.65) !important;
}
.app-credit-pill--unlimited .bi-gem {
    color: #a7f3d0 !important;
}

/* Sub-abas da Gestão de Equipe */
.admin-equipe-subtabs .nav-link {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid transparent;
}
.admin-equipe-subtabs .nav-link:hover {
    color: #0f172a;
    background: #e2e8f0;
}
.admin-equipe-subtabs .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, #059669, #047857) !important;
    border-color: rgba(5, 150, 105, 0.4);
}
.admin-historico-feed__item {
    border-color: #e2e8f0 !important;
}

/* === MOBILE/PWA === */
@media screen and (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    input, textarea, [contenteditable], p, span, div {
        -webkit-user-select: auto;
        user-select: auto;
    }
    
    button, .btn, i {
        -webkit-user-select: none;
        user-select: none;
    }

    .app-header .container {
        flex-wrap: wrap;
        gap: 8px;
    }
    .app-header .container > div:last-child {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

/* =========================================
   2. LANDING PAGE
   ========================================= */
/* LoginOverlay: landing page, posição relativa para scroll natural do body */
#loginOverlay {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100vh;
    width: 100%;
    background: #ffffff;
    z-index: 1050;
}

/* Filhos do overlay NÃO encolhem - garante que conteúdo gere scroll */
#loginOverlay > * {
    flex-shrink: 0;
}

/* Quando loginOverlay é removido (após login), CSS não aplica mais */
/* Não precisa mais de regras para overlay oculto */
/* ===== LANDING HEADER STICKY ===== */
.landing-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 0.6rem 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    background: transparent;
}
.landing-header.scrolled {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.landing-brand-name { color: #fff; transition: color 0.3s; }
.landing-header.scrolled .landing-brand-name { color: #047857; }
.landing-nav-link { color: rgba(255,255,255,0.9) !important; font-weight: 600; font-size: 0.92rem; padding: 0.45rem 0.85rem !important; border-radius: 8px; transition: background 0.2s, color 0.2s; }
.landing-nav-link:hover { background: rgba(255,255,255,0.15); color: #fff !important; }
.landing-header.scrolled .landing-nav-link { color: #374151 !important; }
.landing-header.scrolled .landing-nav-link:hover { background: #f0fdf4; color: #047857 !important; }
.landing-toggler-icon { font-size: 1.5rem; color: #fff; line-height: 1; }
.landing-header.scrolled .landing-toggler-icon { color: #374151; }
.landing-header.scrolled .btn-outline-black { border-color: #047857 !important; color: #047857 !important; background: transparent !important; }
.landing-header.scrolled .btn-outline-black:hover { background: #047857 !important; color: #fff !important; }
.landing-header.scrolled .btn-black { background: #047857 !important; color: #fff !important; border-color: #047857 !important; }

/* Mobile Header Improvement */
@media screen and (max-width: 991px) {
    .landing-header {
        position: sticky;
        background: linear-gradient(135deg, rgba(6, 78, 59, 0.85) 0%, rgba(3, 105, 161, 0.85) 100%) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    
    .landing-header.scrolled {
        background: rgba(255, 255, 255, 0.97) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    
    .landing-header:not(.scrolled) .navbar-collapse.show {
        background: linear-gradient(180deg, rgba(6, 78, 59, 0.98) 0%, rgba(3, 105, 161, 0.98) 100%);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-radius: 0 0 16px 16px;
        padding: 1.2rem 0;
    }
    
    .landing-header:not(.scrolled) .navbar-collapse.show .nav-link {
        color: #fff !important;
    }

    /* Melhora de contraste dos botões no menu mobile aberto */
    .landing-header .navbar-collapse.show .landing-auth-actions {
        width: 100%;
        justify-content: center;
        gap: 0.75rem !important;
    }

    .landing-header .navbar-collapse.show .landing-auth-btn {
        min-width: 140px;
        font-weight: 800;
        border-width: 2px !important;
    }

    .landing-header:not(.scrolled) .navbar-collapse.show .btn-outline-black {
        color: #ffffff !important;
        border-color: #ffffff !important;
        background: rgba(255, 255, 255, 0.14) !important;
    }

    .landing-header:not(.scrolled) .navbar-collapse.show .btn-black {
        color: #0f172a !important;
        border-color: #ffffff !important;
        background: #ffffff !important;
    }

    .landing-header.scrolled .navbar-collapse.show .btn-outline-black {
        color: #047857 !important;
        border-color: #047857 !important;
        background: rgba(4, 120, 87, 0.1) !important;
    }

    .landing-header.scrolled .navbar-collapse.show .btn-black {
        color: #ffffff !important;
        border-color: #047857 !important;
        background: #047857 !important;
    }
}

.hero-section { background: linear-gradient(135deg, #047857 0%, #0369a1 100%); padding-top: calc(5rem + 72px); padding-bottom: 7rem; position: relative; }
.hero-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.1); pointer-events: none; }
.hero-section * { position: relative; z-index: 1; }
.hero-section h1, .hero-section p, .hero-section .text-dark-solid, .hero-section h3 { color: #ffffff !important; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.hero-section .badge { background-color: rgba(255, 255, 255, 0.25) !important; color: #ffffff !important; border: 1px solid rgba(255, 255, 255, 0.5) !important; font-weight: 700; }
.hero-section .btn-black { background-color: #ffffff !important; color: #0369a1 !important; font-weight: 800; border: 2px solid #ffffff !important; }
.hero-section .btn-black:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.3) !important; transform: translateY(-2px); }
.hero-section .btn-outline-black { border: 2px solid rgba(255, 255, 255, 0.9) !important; color: #ffffff !important; background-color: rgba(255,255,255,0.15) !important; font-weight: 700; }
.hero-section .btn-outline-black:hover { background-color: #ffffff !important; color: #0369a1 !important; border-color: #ffffff !important; }
.landing-auth-actions {
    gap: 0.75rem !important;
}

.landing-auth-btn {
    min-height: 42px;
    padding: 0.55rem 1rem !important;
    font-size: 0.95rem;
    line-height: 1;
    border-radius: 12px !important;
    white-space: nowrap;
}

/* =========================================
   RÓTULO NUTRICIONAL - LARGURA CONSISTENTE
   Tudo fora da tabela deve acompanhar a mesma largura da tabela
   ========================================= */
#rotuloCompleto .tn-title,
#rotuloCompleto #lblPorcoesTopo,
#rotuloCompleto #rotulagemFrontalContainer,
#rotuloCompleto #boxDadosEmpresa,
#rotuloCompleto #lblIngredientes,
#rotuloCompleto #lblAlergicos,
#rotuloCompleto #lblLoteValidade,
#rotuloCompleto #lblModoConservacaoWrap,
#rotuloCompleto #lblPesoLiquido,
#rotuloCompleto #txtLinearCorpo {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

#rotuloCompleto .tn-title,
#rotuloCompleto #lblPorcoesTopo,
#rotuloCompleto #lblIngredientes,
#rotuloCompleto #lblAlergicos,
#rotuloCompleto #lblLoteValidade,
#rotuloCompleto #lblModoConservacaoWrap,
#rotuloCompleto #lblPesoLiquido {
    overflow-wrap: anywhere;
    word-break: break-word;
}

#rotuloCompleto #rotulagemFrontalContainer > div,
#rotuloCompleto #boxDadosEmpresa > *,
#rotuloCompleto #txtLinearCorpo > div {
    width: 100%;
    box-sizing: border-box;
}

#rotuloCompleto table {
    width: 100% !important;
    max-width: 100% !important;
    font-family: Arial, sans-serif !important;
}

#rotuloCompleto table th,
#rotuloCompleto table td,
.table-nutri,
.table-nutri th,
.table-nutri td,
#print-only table,
#print-only th,
#print-only td {
    font-family: Arial, sans-serif !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

.hero-primary-cta {
    min-height: 52px;
    padding: 0.9rem 1.9rem !important;
    font-size: 1.05rem !important;
    border-radius: 14px !important;
}

@media screen and (max-width: 768px) {
    .landing-nav {
        gap: 0.85rem;
        margin-bottom: 2rem !important;
    }

    .hero-section {
        padding-top: calc(2.25rem + 64px);
        padding-bottom: 3.5rem;
    }

    .landing-nav > div:first-child {
        gap: 0.75rem !important;
    }

    .landing-nav > div:first-child img {
        width: 48px !important;
        height: 48px !important;
    }

    .landing-nav .fs-4 {
        font-size: 1.2rem !important;
    }

    .hero-section .col-lg-6 {
        margin-bottom: 2rem !important;
    }

    .hero-section .badge {
        font-size: 0.78rem !important;
        padding: 0.5rem 0.85rem !important;
    }

    .hero-section h1.display-4 {
        font-size: 2rem;
        margin-bottom: 1rem !important;
    }

    .hero-section .fs-5 {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .hero-section p.mb-4,
    .hero-section .alert.mb-4 {
        margin-bottom: 1rem !important;
    }

    .real-preview-card {
        max-width: 420px !important;
        transform: none;
        animation: none;
    }

    .landing-auth-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.875rem !important;
    }

    .landing-auth-btn {
        min-height: 38px;
        padding: 0.45rem 0.85rem !important;
        font-size: 0.88rem;
        border-width: 1.5px !important;
    }

    .hero-primary-cta {
        min-height: 46px;
        padding: 0.7rem 1.3rem !important;
        font-size: 0.95rem !important;
        box-shadow: 0 10px 20px rgba(0,0,0,0.18) !important;
    }
}

@media screen and (max-width: 480px) {
    .landing-nav {
        align-items: flex-start !important;
        margin-bottom: 1.4rem !important;
    }

    .hero-section {
        padding-top: calc(1.5rem + 60px);
        padding-bottom: 2.5rem;
    }

    .landing-nav > div:first-child img {
        width: 42px !important;
        height: 42px !important;
    }

    .landing-nav .fs-4 {
        font-size: 1.02rem !important;
        letter-spacing: -0.4px !important;
    }

    .landing-auth-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .landing-auth-btn {
        min-width: 108px;
        padding: 0.4rem 0.75rem !important;
        font-size: 0.82rem;
    }

    .hero-primary-cta {
        width: 100%;
        max-width: 240px;
        min-height: 44px;
        padding: 0.68rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .hero-section .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-section h1.display-4 {
        font-size: 1.65rem;
        line-height: 1.15 !important;
    }

    .hero-section .fs-5 {
        font-size: 0.95rem !important;
    }

    .hero-section p.mb-2,
    .hero-section p.mb-4 {
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .hero-section .alert {
        padding: 0.75rem 0.85rem !important;
    }

    .hero-section .alert small {
        font-size: 0.78rem;
    }

    .hero-section .col-lg-5 {
        margin-top: 1.5rem !important;
    }

    .real-preview-card {
        max-width: 100% !important;
        padding: 0.9rem !important;
        border-radius: 16px !important;
    }
}

.real-preview-card { 
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important; 
    border: none !important; 
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important; 
    border-radius: 20px !important; 
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg); 
    animation: floatCard 6s ease-in-out infinite; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.real-preview-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    animation: shimmer 8s linear infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.real-preview-card:hover { 
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.04); 
    box-shadow: 
        0 35px 60px -15px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(16, 185, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}
@keyframes floatCard { 0% { transform: translateY(0px) perspective(1000px) rotateY(-5deg) rotateX(5deg); } 50% { transform: translateY(-20px) perspective(1000px) rotateY(-5deg) rotateX(5deg); } 100% { transform: translateY(0px) perspective(1000px) rotateY(-5deg) rotateX(5deg); } }
.rdc-badge { position: absolute; top: -15px; right: -15px; background: var(--dark-solid); color: white; padding: 6px 18px; border-radius: 30px; font-weight: 800; font-size: 0.85rem; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.anim-fade-up { opacity: 0; animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; transform: translateY(30px); }
.anim-delay-1 { animation-delay: 0.2s; } .anim-delay-2 { animation-delay: 0.4s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* Selo Cronômetro - Gerado em 3s */
.generated-timer {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    box-shadow: 
        0 4px 12px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: timerSlideIn 0.5s ease-out 1.5s both;
}

@keyframes timerSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.timer-icon {
    font-size: 1.4rem;
    animation: timerSpin 1s ease-in-out 2s both;
}

@keyframes timerSpin {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(360deg); }
    100% { transform: rotate(360deg); }
}

.timer-text {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
    display: block;
    line-height: 1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.timer-value {
    font-size: 1.3rem;
    font-weight: 800;
    display: block;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.timer-check {
    font-size: 1.3rem;
    color: #a7f3d0;
    animation: checkPop 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) both;
}

@keyframes checkPop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Melhorias visuais da tabela nutricional na landing page */
.real-preview-card .bg-white {
    background: linear-gradient(145deg, #ffffff 0%, #fafafa 100%) !important;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 2px 4px -1px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease;
}

.real-preview-card .bg-white:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.real-preview-card h6 {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #000 !important;
    padding-bottom: 8px !important;
    text-transform: uppercase;
    background: linear-gradient(90deg, #000 0%, #333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.real-preview-card table tr {
    transition: all 0.2s ease;
}

.real-preview-card table tr:hover {
    background: rgba(16, 185, 129, 0.04) !important;
    transform: translateX(3px);
}

.real-preview-card table tr.border-bottom {
    border-bottom: 2px solid rgba(0, 0, 0, 0.12) !important;
}

.real-preview-card table tr.bg-light {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%) !important;
}

.real-preview-card table td {
    font-size: 0.72rem !important;
    padding: 6px 4px !important;
    font-weight: 500;
}

.real-preview-card table td.fw-bold {
    font-weight: 700 !important;
    color: #0f172a !important;
}

.real-preview-card table td.text-danger {
    color: #dc2626 !important;
    font-weight: 700 !important;
    text-shadow: 0 0 8px rgba(220, 38, 38, 0.2);
}

.real-preview-card .text-center.border {
    background: linear-gradient(135deg, #000 0%, #1f2937 100%) !important;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid #000 !important;
    transition: all 0.3s ease;
}

.real-preview-card .text-center.border:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.real-preview-card .border-top {
    border-top: 2px solid rgba(0, 0, 0, 0.1) !important;
    background: rgba(249, 250, 251, 0.5);
    padding: 8px 0 !important;
    margin-top: 8px !important;
}

.real-preview-card .rdc-badge {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.real-preview-card .rdc-badge:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Efeito de brilho no QR code */
.real-preview-card .bg-white.p-1.border {
    animation: qrPulse 3s ease-in-out infinite;
}

@keyframes qrPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.3); }
}

/* =========================================
   3. SEÇÃO DE FEATURES E FAQ
   ========================================= */
.feature-box { padding: 2rem; background: #f8fafc; border-radius: 16px; border: 1px solid #e2e8f0; height: 100%; transition: all 0.3s ease; }
.feature-box:hover { background: #ffffff; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); transform: translateY(-5px); }
.feature-icon { width: 50px; height: 50px; background: #e0f2fe; color: #0284c7; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }

/* Step-by-step - Seção Como Funciona */
.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    z-index: 2;
}
.step-icon {
    width: 100px;
    height: 100px;
    background: #f0fdf4;
    border: 3px solid #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #059669;
    transition: all 0.3s ease;
}
.step-icon:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}
.accordion-item { border: 1px solid #e2e8f0; border-radius: 12px !important; margin-bottom: 1rem; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.accordion-button { font-weight: 700; color: var(--dark-solid); padding: 1.25rem 1.5rem; background-color: #ffffff; }
.accordion-button:not(.collapsed) { background-color: #f0fdf4; color: #166534; box-shadow: none; }
.btn-black { background-color: var(--dark-solid) !important; color: #fff !important; border-radius: 10px !important; border: none !important; transition: all 0.3s ease; }
.btn-black:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(15,23,42,0.2) !important; }
.btn-outline-black { border: 2px solid var(--dark-solid) !important; border-radius: 10px !important; color: var(--dark-solid) !important; font-weight: 700; background: transparent; }
.btn-outline-black:hover { background-color: var(--dark-solid) !important; color: #fff !important; }

/* Melhorias de contraste para acessibilidade */
.btn-outline-danger { 
    border-color: #b91c1c !important; 
    color: #b91c1c !important; 
    font-weight: 700 !important;
}
.btn-outline-danger:hover { 
    background-color: #b91c1c !important; 
    color: #ffffff !important; 
}
.btn-outline-primary { 
    border-color: #1e40af !important; 
    color: #1e40af !important; 
    font-weight: 700 !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-check:checked + .btn-outline-primary { 
    background-color: #1e40af !important; 
    color: #ffffff !important; 
    border-color: #1e40af !important;
}
.alert-info { 
    background-color: #dbeafe !important; 
    border-color: #1e40af !important; 
    color: #1e3a8a !important; 
}
.alert-info .fw-bold {
    color: #1e3a8a !important;
}

.modal-content { border-radius: 20px !important; border: none !important; overflow: hidden; }

/* Dropdown mobile para ingredientes */
.dropdown-mobile {
    border: 1px solid #dee2e6 !important;
    max-width: 100%;
}

.dropdown-item-mobile {
    padding: 14px 18px !important;
    border-bottom: 1px solid #e5e7eb !important;
    transition: all 0.2s ease !important;
    font-size: 0.95rem !important;
    color: #1f2937 !important;
    background-color: #ffffff !important;
}

.dropdown-item-mobile:last-child {
    border-bottom: none !important;
    border-radius: 0 0 8px 8px !important;
}

.dropdown-item-mobile:first-child {
    border-radius: 8px 8px 0 0 !important;
}

.dropdown-item-mobile:active {
    background-color: #f3f4f6 !important;
    transform: scale(0.98);
}

.dropdown-item-mobile:hover {
    background-color: #f9fafb !important;
}

/* Melhorias para touch no mobile */
@media (max-width: 768px) {
    .dropdown-item-mobile {
        padding: 16px 20px !important;
        font-size: 1rem !important;
        min-height: 50px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .glass-card .input-group {
        position: relative !important;
    }
    
    #mobileDropdown {
        margin-top: 6px !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
        border: 1px solid #e5e7eb !important;
        background: #ffffff !important;
    }
}
.auth-left-pane { background: linear-gradient(135deg, #059669 0%, #0f172a 100%); color: white; }
.form-control { border-radius: 10px !important; padding: 0.75rem 1rem !important; border: 1px solid #cbd5e1 !important; background-color: #f8fafc !important; }

/* =========================================
   4. TABELA NUTRICIONAL E RÓTULO
   ========================================= */
.rotulo-box { background: #fff !important; border: 1px solid #000 !important; padding: 15px !important; width: 100%; max-width: 100%; color: #000 !important; font-family: 'Arial', sans-serif; overflow: hidden; box-sizing: border-box; }

#rotuloCompleto {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Clone PNG/PDF (html2canvas): sem id #rotuloCompleto, mantém classes no mesmo nó */
.rotuloCompleto-root {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-left: auto !important;
    margin-right: auto !important;
}

#rotuloContainer {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#rotuloCompleto > .legal-area {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#rotuloCompleto > .legal-area > *,
#rotuloCompleto > .legal-area #rodapeLegal,
#rotuloCompleto > .legal-area #boxDadosEmpresa,
#rotuloCompleto > .legal-area #lblIngredientes,
#rotuloCompleto > .legal-area #lblAlergicos,
#rotuloCompleto > .legal-area #lblGluten,
#rotuloCompleto > .legal-area #lblPesoLiquido,
#rotuloCompleto > .legal-area #lblLoteValidade,
#rotuloCompleto > .legal-area #lblModoConservacaoWrap,
#rotuloCompleto > .legal-area #lblEmpresaNome,
#rotuloCompleto > .legal-area #lblEmpresaCNPJ,
#rotuloCompleto > .legal-area #lblEmpresaIE,
#rotuloCompleto > .legal-area #lblEmpresaEnd,
#rotuloCompleto > .legal-area #lblEmpresaSAC,
#rotuloCompleto > .legal-area #lblEmpresaSite,
#rotuloCompleto > .legal-area #barcodeContainer {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#rotuloCompleto > #rotulagemFrontalContainer {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.layout-vertical .legal-area,
.layout-vertical #rodapeLegal,
.layout-vertical #boxDadosEmpresa,
.layout-vertical #lblIngredientes,
.layout-vertical #lblAlergicos,
.layout-vertical #lblGluten,
.layout-vertical #lblLoteValidade,
.layout-vertical #lblModoConservacaoWrap,
.layout-vertical #lblEmpresaNome,
.layout-vertical #lblEmpresaEnd,
.layout-vertical #lblEmpresaSite,
.layout-vertical #lblEmpresaSAC,
.layout-vertical #lblEmpresaCNPJ,
.layout-vertical #lblEmpresaIE,
.layout-vertical #lblIndustriaBrasileira,
.layout-compacto-wrapper .legal-area,
.layout-compacto-wrapper .legal-area > *,
.layout-compacto-wrapper .legal-area .mb-3,
.layout-compacto-wrapper .legal-area .small,
.layout-compacto-wrapper .legal-area p,
.layout-compacto-wrapper .legal-area div,
.layout-compacto-wrapper .legal-area span,
.layout-compacto-wrapper .legal-area label,
.layout-compacto-wrapper .legal-area strong,
.layout-compacto-wrapper .legal-area em,
.layout-compacto-wrapper .legal-area #rodapeLegal,
.layout-compacto-wrapper .legal-area #boxDadosEmpresa,
.layout-compacto-wrapper .legal-area #lblIngredientes,
.layout-compacto-wrapper .legal-area #lblAlergicos,
.layout-compacto-wrapper .legal-area #lblGluten,
.layout-compacto-wrapper .legal-area #lblLoteValidade,
.layout-compacto-wrapper .legal-area #lblModoConservacaoWrap,
.layout-compacto-wrapper .legal-area #lblEmpresaNome,
.layout-compacto-wrapper .legal-area #lblEmpresaEnd,
.layout-compacto-wrapper .legal-area #lblEmpresaSite,
.layout-compacto-wrapper .legal-area #lblEmpresaSAC,
.layout-compacto-wrapper .legal-area #lblEmpresaCNPJ,
.layout-compacto-wrapper .legal-area #lblEmpresaIE,
.layout-compacto-wrapper .legal-area #lblIndustriaBrasileira {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
.table-nutri { width: 100%; table-layout: fixed; border-collapse: collapse; border: 2px solid #000 !important; }
.table-nutri th { border-bottom: 2px solid #000 !important; font-weight: bold; padding: 4px 2px !important; border-right: none !important; border-left: none !important; border-top: none !important; }
.table-nutri th:last-child { border-right: none !important; }
.table-nutri td, .table-nutri th { color: #000 !important; padding: 4px 2px !important; word-break: break-word; overflow-wrap: anywhere; border-right: none !important; border-left: none !important; border-top: none !important; border-bottom: none !important; }
.table-nutri tbody tr { border-bottom: 1px solid #000 !important; }
.table-nutri tbody tr:last-child { border-bottom: none !important; }

/* LAYOUT VERTICAL */
.layout-vertical { max-width: 100%; margin: 0 auto; overflow: hidden; min-height: 100%; }
.layout-vertical .table-nutri {
    font-size: 0.9rem;
    width: 76%;
    margin-left: auto;
    margin-right: 0;
    border-collapse: collapse !important;
}
.layout-vertical .table-nutri td,
.layout-vertical .table-nutri th {
    padding: 4px 2px !important;
    line-height: 1.2;
    box-sizing: border-box;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
}
.layout-vertical .table-nutri thead tr {
    border-bottom: 2px solid #000 !important;
}
.layout-vertical .table-nutri tbody tr {
    border-bottom: 1px solid #000 !important;
}
.layout-vertical .table-nutri tbody tr:last-child {
    border-bottom: none !important;
}
.layout-vertical .table-nutri th:first-child,
.layout-vertical .table-nutri td:first-child {
    width: 46%;
    font-size: 0.82rem;
    padding-right: 4px !important;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.2;
    max-width: 0;
    text-align: left !important;
    box-sizing: border-box;
}
.layout-vertical .table-nutri th:nth-child(2),
.layout-vertical .table-nutri th:nth-child(3),
.layout-vertical .table-nutri th:nth-child(4),
.layout-vertical .table-nutri td:nth-child(2),
.layout-vertical .table-nutri td:nth-child(3),
.layout-vertical .table-nutri td:nth-child(4) {
    text-align: center !important;
    padding: 4px 2px !important;
    font-variant-numeric: tabular-nums;
    width: 18%;
    min-width: 0;
    white-space: nowrap;
    box-sizing: border-box;
}
.layout-vertical .legal-area,
.layout-vertical #rodapeLegal,
.layout-vertical #boxDadosEmpresa,
.layout-vertical #lblIngredientes,
.layout-vertical #lblAlergicos,
.layout-vertical #lblGluten,
.layout-vertical #lblLoteValidade,
.layout-vertical #lblModoConservacaoWrap,
.layout-vertical #lblEmpresaNome,
.layout-vertical #lblEmpresaEnd,
.layout-vertical #lblEmpresaSite,
.layout-vertical #lblEmpresaSAC,
.layout-vertical #lblEmpresaCNPJ,
.layout-vertical #lblEmpresaIE,
.layout-vertical #lblIndustriaBrasileira {
    display: block;
    width: 76% !important;
    max-width: 76% !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    box-sizing: border-box;
}

/* 🔥 LAYOUT HORIZONTAL 🔥 */
.layout-horizontal { max-width: 100% !important; margin: 0 auto; }
.layout-horizontal .table-nutri { display: block; width: 100%; border: none !important; margin: 0 !important; }

/* Troca de cabeçalhos */
.layout-horizontal .head-vertical { display: none !important; }
.layout-horizontal .head-horizontal { display: block !important; width: 100%; border-bottom: 2px solid #000 !important; margin-bottom: 4px; padding-bottom: 4px; }
.layout-horizontal .head-horizontal td { display: block; padding: 0 !important; border: none !important; width: 100%; }

.horizontal-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}
.header-col {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1fr; 
    text-align: center;
    font-weight: bold;
}

/* Corpo da tabela usando Grid Auto-Flow */
.layout-horizontal .table-nutri tbody {
    display: grid;
    grid-template-rows: repeat(5, auto); 
    grid-auto-flow: column;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
    width: 100%;
}

.layout-horizontal .table-nutri tr {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1fr; 
    border-bottom: 1px solid #000;
    align-items: center;
    padding: 4px 0;
    width: 100%;
}

.layout-horizontal .table-nutri td {
    border: none !important;
    padding: 0 6px !important;
    text-align: center;
    font-size: 0.85rem;
    vertical-align: middle;
}

.layout-horizontal .table-nutri td:nth-child(2),
.layout-horizontal .table-nutri td:nth-child(3),
.layout-horizontal .table-nutri td:nth-child(4) {
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    font-variant-numeric: tabular-nums;
    width: 16%;
    min-width: 48px;
    white-space: nowrap;
    box-sizing: border-box;
}

.layout-horizontal .table-nutri td:nth-child(2) {
    padding-left: 0 !important;
}

.layout-horizontal .table-nutri td:nth-child(3) {
    padding-left: 0 !important;
}

.layout-horizontal .table-nutri td:nth-child(1) { text-align: left; }

/* LAYOUT LINEAR */
.layout-linear { max-width: 100% !important; border: none !important; padding: 0 !important; }
.layout-linear .tn-title { display: none !important; }
.layout-linear #lblPorcoesTopo { display: none !important; }
.layout-linear table { display: none !important; }

.glass-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.section-title { font-size: 0.8rem; font-weight: 800; color: var(--text-muted); margin-bottom: 1rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Colapsar “Dados da receita” na aba Rótulo — sobe a seção de ingredientes */
#cardDadosReceita .dados-receita-card-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.65rem;
    margin-bottom: 0.75rem;
}
#cardDadosReceita .dados-receita-card-header .section-title {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
#cardDadosReceita #painelDadosReceita.collapsing {
    transition: height 0.22s ease;
}

/* Barra de layout/exportação do rótulo: evita botões mais altos por quebra de linha */
.rotulo-controls-toolbar .btn {
    white-space: nowrap;
}
.rotulo-controls-toolbar .rotulo-export-group .dropdown-toggle {
    line-height: 1.25;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.rotulo-export-dropdown .dropdown-item {
    white-space: nowrap;
}
.rotulo-controls-toolbar .rotulo-layout-group .btn {
    flex: 0 0 auto;
}
.gradient-text { background: linear-gradient(90deg, #ffffff, #fef08a, #ffffff); background-size: 220% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; display: inline-block; animation: titleShine 3s linear infinite; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25)); }

@keyframes titleShine {
    from { background-position: 0% center; }
    to { background-position: 220% center; }
}

/* Garantir que botões de toggle sempre exibam o texto corretamente */
#viewBtnRotulo span, #viewBtnFicha span {
    display: inline;
    white-space: nowrap;
}

/* 🔥 ANIMAÇÃO DO ALERTA DE ALERGÊNICOS 🔥 */
@keyframes input-flash {
    0% { background-color: #ffffff; border-color: #ced4da; }
    50% { background-color: #fff3cd; border-color: #ffc107; box-shadow: 0 0 10px rgba(255, 193, 7, 0.5); }
    100% { background-color: #ffffff; border-color: #ced4da; }
}
.input-alert {
    animation: input-flash 1s ease-in-out;
}

/* =========================================
   5. TERMOS & LGPD
   ========================================= */
.legal-links a {
    color: var(--dark-solid);
    font-weight: 700;
    text-decoration: none;
}
.legal-links a:hover {
    text-decoration: underline;
}
.legal-doc h6 {
    font-size: 0.95rem;
}
.legal-doc p, .legal-doc li {
    line-height: 1.55;
}
/* YouTube Shorts (vertical 9:16) usando Bootstrap .ratio */
.ratio-9x16 { --bs-aspect-ratio: 177.7778%; }

#video-demo .video-card {
  max-width: 420px;
  margin: 0 auto;
}
/* =========================================
   NOVO LAYOUT: LATERAL (COMPACTO) - CORRIGIDO
   ========================================= */

/* 1. Força o container pai a ser Flexbox em linha (lado a lado) */
.rotuloCompleto-root.layout-compacto-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 880px !important;
    padding: 0 !important;
    border: 2px solid #000 !important;
    box-sizing: border-box !important;
    background: #fff !important;
    /* flex-start: evita esticar a coluna legal até a altura da tabela (APK/WebView ficava com muito vazio) */
    align-items: flex-start !important;
}

/* 2. Lupa Frontal (Topo - Ocupa 100%) */
.rotuloCompleto-root.layout-compacto-wrapper #rotulagemFrontalContainer {
    width: 100% !important;
    flex: 0 0 100% !important;
    border-bottom: 2px solid #000 !important;
    margin: 0 !important;
    padding: 8px !important;
    justify-content: center !important;
}
.rotuloCompleto-root.layout-compacto-wrapper #rotulagemFrontalContainer.d-none {
    display: none !important;
}

/* 3. Tabela (esquerda) um pouco mais larga que o bloco legal — melhora leitura e exportação */
.rotuloCompleto-root.layout-compacto-wrapper #rotuloContainer {
    display: block !important;
    width: 53% !important;
    flex: 0 0 53% !important;
    max-width: 53% !important;
    margin: 0 !important;
    border: none !important;
    border-right: 2px solid #000 !important;
    padding: 8px 8px !important;
    box-sizing: border-box !important;
    /* .layout-vertical usa min-height:100% — no compacto isso força coluna alta demais */
    min-height: 0 !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #rotuloContainer .table-nutri {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 4. Dados legais (direita) */
.rotuloCompleto-root.layout-compacto-wrapper .legal-area {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    width: 47% !important;
    flex: 0 0 47% !important;
    max-width: 47% !important;
    margin: 0 !important;
    padding: 8px 8px !important;
    box-sizing: border-box !important;
    font-family: Arial, sans-serif !important;
    font-size: 0.75rem !important;
    line-height: 1.25 !important;
}

/* 5. Garante que elementos internos não quebrem a divisão de 50% */
.rotuloCompleto-root.layout-compacto-wrapper .legal-area > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* 6. Formatação do título na direita para combinar */
.rotuloCompleto-root.layout-compacto-wrapper .legal-area #lblIngredientes {
    text-align: justify !important;
}

/* 7. Rodapé compacto: coluna (QR central) + quebra de palavras correta na tabela */
.rotuloCompleto-root.layout-compacto-wrapper #rodapeLegal {
    margin-top: 0.65rem !important;
    padding-top: 10px !important;
    border-top: 1px solid #ccc !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #rodapeLegal #boxDadosEmpresa {
    align-self: stretch !important;
    text-align: left !important;
    width: 100% !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #qrCodeContainer {
    margin-left: auto !important;
    margin-right: auto !important;
    margin-inline: auto !important;
    transform: none !important;
    align-self: center !important;
    text-align: center !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #barcodeContainer {
    text-align: center !important;
    margin-top: 10px !important;
    display: block !important;
    width: 100% !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #barcodeImg {
    max-width: 120px !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.rotuloCompleto-root.layout-compacto-wrapper .legal-area > #lblIndustriaBrasileira {
    margin-top: 8px !important;
    padding-top: 6px !important;
    text-align: center !important;
    font-weight: 700 !important;
    border-top: 1px solid #e2e8f0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Sobrescreve .table-nutri global: sem quebra no meio da palavra (evita "Carboid/ratos") */
.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados {
    table-layout: fixed !important;
    width: 100% !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados th,
.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados td {
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
}

/* Coluna de textos: mais largura + respiro antes dos números (web). Bloco numérico ~37% evita “vão” entre 100g/porção/%VD no WebView do APK. */
.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados thead tr.head-vertical th:first-child {
    width: 63% !important;
    max-width: 63% !important;
    padding-right: 0.5rem !important;
    box-sizing: border-box !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados tbody td:first-child {
    width: 63% !important;
    max-width: 63% !important;
    padding-right: 0.5rem !important;
    box-sizing: border-box !important;
    font-size: 0.62rem !important;
    line-height: 1.15 !important;
    vertical-align: top !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados tbody td:nth-child(2),
.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados tbody td:nth-child(3),
.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados tbody td:nth-child(4),
.rotuloCompleto-root.layout-compacto-wrapper #tabelaDados thead tr.head-vertical th:nth-child(n+2) {
    width: 12.333% !important;
    max-width: 12.333% !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    font-size: 0.6rem !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
}

/* 8. Responsividade (Celular) - Desfaz o lado a lado se a tela for minúscula */
@media (max-width: 640px) {
    .rotuloCompleto-root.layout-compacto-wrapper {
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        border-width: 1px !important;
    }

    .rotuloCompleto-root.layout-compacto-wrapper #rotuloContainer,
    .rotuloCompleto-root.layout-compacto-wrapper .legal-area {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        border-right: none !important;
        padding: 8px 10px !important;
    }

    .rotuloCompleto-root.layout-compacto-wrapper .legal-area {
        font-size: 0.7rem !important;
        line-height: 1.18 !important;
        justify-content: flex-start !important;
    }

    .rotuloCompleto-root.layout-compacto-wrapper #barcodeImg {
        max-width: 100px !important;
    }

    #rotuloCompleto {
        width: 100% !important;
        max-width: 100% !important;
    }

    .layout-vertical {
        max-width: 100% !important;
    }

    .layout-vertical .table-nutri,
    .layout-horizontal .table-nutri {
        width: 100% !important;
    }

    .layout-vertical .legal-area,
    .layout-vertical #rodapeLegal,
    .layout-vertical #boxDadosEmpresa,
    .layout-vertical #lblIngredientes,
    .layout-vertical #lblAlergicos,
    .layout-vertical #lblGluten,
    .layout-vertical #lblLoteValidade,
    .layout-vertical #lblModoConservacaoWrap,
    .layout-vertical #lblEmpresaNome,
    .layout-vertical #lblEmpresaEnd,
    .layout-vertical #lblEmpresaSite,
    .layout-vertical #lblEmpresaSAC,
    .layout-vertical #lblEmpresaCNPJ,
    .layout-vertical #lblEmpresaIE,
    .layout-vertical #lblIndustriaBrasileira {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: auto !important;
    }

    .table-nutri td,
    .table-nutri th {
        font-size: 0.72rem !important;
        padding: 3px 2px !important;
    }
}

/* ==========================
   PRINT STYLES
   ========================== */
@media print {
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* Esconde elementos não relevantes */
    body * { visibility: hidden !important; }
    .print-only, .print-only * { visibility: visible !important; }
    .print-only { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; margin: 0 !important; padding: 0 !important; background: #fff !important; overflow: visible !important; }
    .d-print-none { display: none !important; }

    /* Garante cores e ajustes */
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Ajustes para a ficha técnica/table */
    .print-only table { width: 100% !important; border-collapse: collapse !important; table-layout: fixed !important; }
    .print-only th, .print-only td { border: 1px solid #000 !important; padding: 6px !important; font-size: 12px !important; word-break: break-word !important; overflow-wrap: anywhere !important; }

    /* Quebra de página por seções limpas */
    .print-only h2, .print-only h5 { page-break-after: avoid; }
    .print-only table { page-break-inside: avoid; }
    
    /* Garante bordas e alinhamento correto das tabelas nutricionais */
    table { 
        border-collapse: collapse !important; 
        width: 100% !important;
        table-layout: fixed !important;
    }
    
    table th,
    table td {
        padding: 4px 2px !important;
        font-family: Arial, sans-serif !important;
        font-size: 12px !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        border-right: none !important;
        border-left: none !important;
        border-top: none !important;
        border-bottom: none !important;
    }
    
    table thead tr {
        border-bottom: 2px solid #000 !important;
    }
    
    table tbody tr {
        border-bottom: 1px solid #000 !important;
    }
    
    table tbody tr:last-child {
        border-bottom: none !important;
    }
}

/* =========================================
   8. BOTÃO WHATSAPP FLUTUANTE
   ========================================= */
.whatsapp-float {
    position: fixed !important;
    bottom: 25px !important;
    right: 25px !important;
    min-width: 60px;
    height: 60px;
    padding: 0 20px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    border-radius: 30px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 32px;
    box-shadow: 
        0 4px 12px rgba(37, 211, 102, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 99999 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    animation: whatsapp-bounce 2s ease-in-out infinite;
    white-space: nowrap;
    visibility: visible !important;
    opacity: 1 !important;
}

.whatsapp-text {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    display: none;
}

.whatsapp-float:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 
        0 6px 18px rgba(37, 211, 102, 0.5),
        0 12px 32px rgba(0, 0, 0, 0.25);
    color: #ffffff;
    padding: 0 20px 0 15px;
}

.whatsapp-float:hover .whatsapp-text {
    display: block;
}

.whatsapp-float:active {
    transform: scale(0.95);
}

.whatsapp-pulse {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    left: 0;
    top: 0;
}

@keyframes whatsapp-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Mobile responsivo */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        min-width: 56px;
        height: 56px;
        font-size: 28px;
        padding: 0 16px;
    }
    
    .whatsapp-text {
        font-size: 12px;
    }
    
    .whatsapp-pulse {
        width: 56px;
        height: 56px;
    }
}

/* =========================================
   9. SEÇÃO PERSONAS / PARA QUEM É
   ========================================= */
.persona-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 2px 4px -1px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.persona-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.persona-card:hover::before {
    transform: scaleX(1);
}

.persona-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(16, 185, 129, 0.2);
}

.persona-icon {
    width: 80px;
    height: 80px;
    min-width: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ffffff;
    box-shadow: 
        0 4px 6px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.persona-card:hover .persona-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 
        0 8px 12px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.persona-card h4 {
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 800;
}

.persona-card .list-unstyled li {
    padding: 6px 0;
    transition: all 0.2s ease;
}

.persona-card .list-unstyled li:hover {
    transform: translateX(5px);
    color: #10b981;
}

.persona-card .badge {
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.persona-card .badge:hover {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
    transform: translateY(-2px);
}

@media (max-width: 991px) {
    .persona-card .d-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .persona-icon {
        margin: 0 auto 1.5rem;
    }
}

/* =========================================
   PULL-TO-REFRESH E CARREGAMENTO
   ========================================= */
.ptr-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    pointer-events: none;
}

.ptr-icon {
    width: 36px;
    height: 36px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.ptr-icon.visible {
    opacity: 1;
    transform: scale(1);
}

.ptr-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: scale(1) rotate(360deg); }
}

/* Animações de fade-in para receitas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recipe-item {
    animation: fadeInUp 0.3s ease-out backwards;
}

.recipe-item:nth-child(1) { animation-delay: 0.05s; }
.recipe-item:nth-child(2) { animation-delay: 0.1s; }
.recipe-item:nth-child(3) { animation-delay: 0.15s; }
.recipe-item:nth-child(n+4) { animation-delay: 0.2s; }

/* Sync status badge */
.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    margin-top: 0.5rem;
}

.sync-badge.syncing {
    background: #fef3c7;
    color: #92400e;
}

.sync-badge.synced {
    background: #dcfce7;
    color: #166534;
}

.sync-badge.offline {
    background: #fee2e2;
    color: #991b1b;
}

.sync-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Fix: Botão ABRIR na aba rótulo - não ficar branco no hover */
.btn-outline-dark.bg-white {
    color: #212529;
    border-color: #212529;
}

.btn-outline-dark.bg-white:hover {
    background-color: #212529 !important;
    border-color: #212529 !important;
    color: #ffffff !important;
}

.btn-outline-dark.bg-white:focus,
.btn-outline-dark.bg-white:active {
    background-color: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
}

/* Logo Preview na aba Perfil */
.logo-preview-box {
    width: 120px;
    height: 120px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
    transition: all 0.3s ease;
}

.logo-preview-box:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.logo-preview-box img {
    transition: transform 0.3s ease;
}

.logo-preview-box img:hover {
    transform: scale(1.05);
}

/* === LOGO NO RÓTULO === */
#logoRotuloContainerTop,
#logoRotuloContainerCompacto {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
}

#rotuloCompleto:not(.layout-compacto-wrapper) #logoRotuloContainerTop.d-none {
    display: none !important;
}

#rotuloCompleto:not(.layout-compacto-wrapper) #logoRotuloContainerTop:not(.d-none) {
    display: flex !important;
}

#rotuloCompleto:not(.layout-compacto-wrapper) #logoRotuloContainerCompacto {
    display: none !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #logoRotuloContainerTop {
    display: none !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #logoRotuloContainerCompacto:not(.d-none) {
    display: flex !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #logoRotuloContainerCompacto.d-none {
    display: none !important;
}

.rotuloCompleto-root.layout-compacto-wrapper #logoRotuloContainerCompacto {
    min-height: 38px;
    margin-bottom: 0.35rem !important;
}

#boxDadosEmpresa {
    text-align: left;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#lblEmpresaIE {
    display: block;
    text-align: left;
}

#lblIndustriaBrasileira {
    display: block !important;
    width: 100%;
    text-align: center !important;
    margin-top: 8px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 700;
    clear: both;
    visibility: visible !important;
    opacity: 1 !important;
}

#logoRotuloImage,
#logoRotuloImageTop {
    max-width: 120px;
    max-height: 70px;
    object-fit: contain;
}

/* Modo compacto: coluna legal estreita — logo menor (web + APK) */
#logoRotuloImageCompacto {
    max-width: 80px;
    max-height: 46px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* =========================================
   CANVAS EDITOR
   ========================================= */
.canvas-toolbar {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
}

.canvas-toolbar .btn {
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.canvas-toolbar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 400px;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 20px 20px;
}

.canvas-wrapper canvas {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Canvas Resize Handles */
.canvas-resize-container {
    position: relative;
    display: inline-block;
}

.canvas-resize-handle {
    position: absolute;
    background: #10b981;
    border-radius: 3px;
    z-index: 10;
    transition: background 0.15s;
}

.canvas-resize-handle:hover,
.canvas-resize-handle:active {
    background: #059669;
}

.handle-right {
    right: -6px;
    top: 20%;
    width: 6px;
    height: 60%;
    cursor: ew-resize;
    border-radius: 0 3px 3px 0;
}

.handle-bottom {
    bottom: -6px;
    left: 20%;
    height: 6px;
    width: 60%;
    cursor: ns-resize;
    border-radius: 0 0 3px 3px;
}

.handle-corner {
    right: -8px;
    bottom: -8px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Preset Buttons */
.canvas-preset-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    text-align: left;
    line-height: 1.2;
    transition: all 0.2s ease;
    border-width: 2px !important;
}

.canvas-preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.canvas-preset-btn.active {
    background: #212529 !important;
    color: #fff !important;
    border-color: #212529 !important;
}

.canvas-preset-btn.active .preset-icon {
    border-color: #fff;
}

.canvas-preset-btn.active small {
    color: #ffffffaa !important;
}

/* Preset Icons (mini thumbnails) */
.preset-icon {
    border: 2px solid #333;
    border-radius: 3px;
    background: #f8f9fa;
    flex-shrink: 0;
}

.vertical-icon   { width: 16px; height: 28px; }
.horizontal-icon  { width: 28px; height: 18px; }
.linear-icon      { width: 32px; height: 10px; }
.compacto-icon    { width: 20px; height: 26px; }
.etiqueta-icon    { width: 16px; height: 22px; }
.quadrado-icon    { width: 20px; height: 20px; }
.a4-icon          { width: 18px; height: 26px; }
.story-icon       { width: 14px; height: 24px; border-radius: 4px; }

#canvasAiStatus {
    border-radius: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* =========================================
   BOTTOM TAB BAR (APP NAVIGATION)
   ========================================= */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(148,163,184,0.26);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1040;
    padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}

.app-bottom-nav .tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 600;
    gap: 1px;
    cursor: pointer;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    padding: 0 2px;
    line-height: 1.15;
}

.app-bottom-nav .tab-btn i {
    font-size: 1.22rem;
    transition: transform 0.2s;
}

.app-bottom-nav .tab-btn.active {
    color: #047857;
}

.app-bottom-nav .tab-btn.active i {
    transform: scale(1.1);
}

/* =========================================
   APP SHELL + SIDEBAR (DESKTOP ≥992px)
   ========================================= */
.app-shell {
    min-height: 100vh;
}

.app-shell-main {
    min-width: 0;
}

.app-sidebar {
    display: none;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.4rem 1rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid #e2e8f0;
}

.app-sidebar-logo {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    object-fit: cover;
    flex-shrink: 0;
}

.app-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.app-sidebar-brand-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.app-sidebar-brand-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.25;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    padding-top: 0.25rem;
}

.app-sidebar .tab-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 48px;
    padding: 0.55rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.7rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.app-sidebar .tab-btn i {
    font-size: 1.22rem;
    width: 1.45rem;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.app-sidebar .tab-btn:hover {
    background: #f8fafc;
    color: #0f172a;
}

.app-sidebar .tab-btn.active {
    color: #047857;
    background: #ecfdf5;
    border-color: rgba(4, 120, 87, 0.22);
}

.app-sidebar .tab-btn.active i {
    transform: scale(1.06);
}

/* Gestão de Equipe — sem permissão: bem apagado, sem interação */
.nav-gestao-equipe.nav-gestao-equipe--locked {
    opacity: 0.26;
    pointer-events: none !important;
    cursor: not-allowed;
    filter: grayscale(0.75);
    user-select: none;
    -webkit-user-select: none;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.app-sidebar .nav-gestao-equipe.nav-gestao-equipe--locked:hover {
    background: transparent !important;
    color: #94a3b8 !important;
}

.app-sidebar .nav-gestao-equipe.nav-gestao-equipe--locked.active {
    color: #cbd5e1 !important;
    background: transparent !important;
    border-color: transparent !important;
}

.app-bottom-nav .nav-gestao-equipe.nav-gestao-equipe--locked {
    filter: grayscale(0.75);
}

.app-bottom-nav .nav-gestao-equipe.nav-gestao-equipe--locked.active {
    color: #94a3b8 !important;
}

.app-bottom-nav .nav-gestao-equipe.nav-gestao-equipe--locked.active i {
    transform: none;
}

@media (min-width: 992px) {
    .app-sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--app-sidebar-w);
        z-index: 1042;
        background: #ffffff;
        border-right: 1px solid #e2e8f0;
        box-shadow: 4px 0 28px rgba(15, 23, 42, 0.06);
        padding: 1.1rem 0.85rem 1.25rem;
    }

    .app-shell-main {
        margin-left: var(--app-sidebar-w);
    }

    .app-header {
        position: sticky !important;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
    }

    .app-bottom-nav {
        display: none !important;
    }
}

/* Padding inferior do conteúdo para não ficar atrás da tab bar */
.app-tab-content {
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--app-header-h, 75px));
    padding-bottom: 138px;
}

@media (min-width: 992px) {
    .app-tab-content {
        padding-bottom: 1.75rem;
    }
}

.app-tab-content .container,
.app-tab-content .container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 992px) {
    .app-tab-content .container,
    .app-tab-content .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

/* Tab panels */
.app-tab-panel {
    display: none;
}

.app-tab-panel.active {
    display: block;
}

/* Dashboard cards */
.dash-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dash-card .dash-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.dash-stat {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.dash-label {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.dash-sublabel {
    font-size: 0.62rem;
    line-height: 1.25;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 0.2rem;
    padding: 0 0.15rem;
}

/* Caixa de sugestões (aba Início) — paleta verde RótuloConforme */
.dash-feedback-lab {
    position: relative;
    border-radius: 18px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(4, 120, 87, 0.5), rgba(5, 150, 105, 0.48), rgba(16, 185, 129, 0.42));
    box-shadow: 0 8px 28px rgba(4, 120, 87, 0.12);
}

.dash-feedback-lab__inner {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.15rem 1.2rem 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.dash-feedback-lab__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.35rem;
    color: #fff;
    background: var(--brand-green);
    box-shadow: 0 4px 14px rgba(4, 120, 87, 0.3);
}

.btn-dash-feedback {
    background: var(--brand-green) !important;
    color: #fff !important;
    border: none !important;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-dash-feedback:hover:not(:disabled) {
    background: var(--brand-green-hover) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(4, 120, 87, 0.35) !important;
}

.btn-dash-feedback:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Quick action buttons */
.quick-action {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.quick-action:hover {
    border-color: #10b981;
    background: #f0fdf4;
    color: inherit;
}

.quick-action i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.quick-action span {
    font-size: 0.82rem;
    font-weight: 700;
}

.quick-action--primary {
    background: var(--brand-green) !important;
    border: 2px solid var(--brand-green) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(4, 120, 87, 0.2);
}

.quick-action--primary i {
    color: #fff !important;
    opacity: 0.95;
}

.quick-action--primary:hover {
    background: var(--brand-green-hover) !important;
    border-color: var(--brand-green-hover) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(4, 120, 87, 0.28);
}

.quick-action--primary:hover i {
    color: #fff !important;
    opacity: 1;
}

.quick-action--secondary {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.quick-action--secondary i {
    color: #475569 !important;
}

.quick-action--secondary:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

.quick-action--secondary:hover i {
    color: #334155 !important;
}

/* Recipe list in tab */
.recipe-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.2s;
}

.recipe-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Profile section */
.profile-section {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.profile-section h6 {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Gestão de equipe — tabela de usuários (aba admin) */
.btn-brand-green {
    background: var(--brand-green);
    border-color: var(--brand-green);
    color: #fff;
}

.btn-brand-green:hover,
.btn-brand-green:focus {
    background: var(--brand-green-hover);
    border-color: var(--brand-green-hover);
    color: #fff;
}

.btn-brand-green:focus-visible {
    box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.22);
}

.admin-license-badge {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
    font-size: 0.78rem;
    padding: 0.4rem 0.8rem;
}

.admin-users-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.admin-users-table {
    margin-bottom: 0;
    font-size: 0.9rem;
    --bs-table-bg: transparent;
}

.admin-users-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.9rem 1rem;
    white-space: nowrap;
}

.admin-users-table tbody td {
    padding: 1rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

.admin-users-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-users-table tbody tr:hover {
    background: #fafbfc;
}

.admin-user-email {
    color: #0369a1;
}

.admin-user-email:hover {
    color: #047857;
    text-decoration: underline !important;
}

.admin-role {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.admin-role--admin {
    background: rgba(4, 120, 87, 0.1);
    color: #047857;
}

.admin-role--tecnico {
    background: #f1f5f9;
    color: #475569;
}

.admin-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.admin-status--ativo {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid rgba(4, 120, 87, 0.2);
}

.admin-status--bloqueado {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.18);
}

.btn-icon-action {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-icon-action:hover {
    background: #f8fafc;
    color: #047857;
    border-color: #cbd5e1;
}

.btn-icon-action--danger:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    color: #334155;
    text-decoration: none;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:hover {
    color: #10b981;
}

.profile-menu-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    color: #64748b;
}

.profile-menu-item .bi-chevron-right {
    margin-left: auto;
    font-size: 0.8rem;
    color: #cbd5e1;
}

@media print {
    .app-header,
    .app-bottom-nav,
    .app-sidebar {
        display: none !important;
    }
    .app-shell-main {
        margin-left: 0 !important;
    }
    .app-tab-content {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

/* .rotulo-quick-actions removido — botões de download ficam dentro do fluxo da aba rótulo */

/* Mascote nutricionista */
.nutri-mascot {
    position: fixed;
    right: 14px;
    bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    z-index: 1038;
}

/* =========================================
   MASCOTE NA ABA AJUDA (tipo "Duolingo")
   ========================================= */
.help-mascot-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.help-mascot-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: flex-end;
    padding: 14px;
}

.help-mascot-avatar {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(3,105,161,0.12));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(148,163,184,0.35);
    transform-origin: center bottom;
    animation: helpMascotFloat 3.4s ease-in-out infinite;
}

.help-mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: translateY(6px);
    filter: drop-shadow(0 12px 18px rgba(2,44,34,0.18));
}

@keyframes helpMascotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.help-mascot-content {
    min-width: 0;
}

.help-mascot-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #0f172a;
}

.help-mascot-badge {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(16,185,129,0.12);
    color: #047857;
    border: 1px solid rgba(16,185,129,0.25);
}

.help-mascot-bubble {
    position: relative;
    background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,41,59,0.96));
    color: #fff;
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 12px 26px rgba(0,0,0,0.28);
}

.help-mascot-bubble::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 22px;
    width: 14px;
    height: 14px;
    background: rgba(15,23,42,0.96);
    transform: rotate(45deg);
    border-left: 1px solid rgba(148,163,184,0.35);
    border-bottom: 1px solid rgba(148,163,184,0.35);
}

.help-mascot-text {
    font-size: 0.86rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.92);
    min-height: 2.6em;
}

/* Efeito "digitando" */
.help-mascot-text.is-typing {
    position: relative;
}

.help-mascot-text.is-typing::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 16px;
    margin-left: 3px;
    transform: translateY(2px);
    background: rgba(255,255,255,0.85);
    animation: helpCaretBlink 0.9s steps(1, end) infinite;
    border-radius: 2px;
}

@keyframes helpCaretBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.help-mascot-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.help-mascot-card.is-pop .help-mascot-bubble {
    animation: helpBubblePop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes helpBubblePop {
    from { transform: scale(0.96); opacity: 0.65; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 420px) {
    .help-mascot-row {
        grid-template-columns: 64px 1fr;
        padding: 12px;
    }
    .help-mascot-avatar {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }
    .help-mascot-text { font-size: 0.84rem; }
}

.nutri-mascot.mascot-elevated {
    z-index: 1046;
}

.nutri-mascot-toggle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 0;
    font-size: 1.45rem;
    background: linear-gradient(135deg, #10b981, #0369a1);
    box-shadow: 0 8px 18px rgba(2, 44, 34, 0.35);
    color: #fff;
}

.nutri-mascot-bubble {
    position: absolute;
    right: 0;
    bottom: 62px;
    width: min(78vw, 300px);
    background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,41,59,0.96));
    color: #fff;
    border-radius: 14px;
    padding: 0.8rem;
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}

.nutri-mascot-bubble::after {
    content: '';
    position: absolute;
    right: 18px;
    bottom: -8px;
    width: 12px;
    height: 12px;
    background: rgba(30,41,59,0.96);
    transform: rotate(45deg);
    border-right: 1px solid rgba(148,163,184,0.35);
    border-bottom: 1px solid rgba(148,163,184,0.35);
}

.nutri-mascot-name {
    font-size: 0.85rem;
}

.nutri-mascot-bubble p {
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.92);
}

/* === OCR MODAL === */
.ocr-upload-area {
    display: block;
    cursor: pointer;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    transition: all 0.3s ease;
}
.ocr-upload-area:hover {
    border-color: #047857;
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(4,120,87,0.15);
}

/* === SEÇÃO PROMO CANVAS EDITOR === */
.canvas-promo-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}
.canvas-promo-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(4,120,87,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(3,105,161,0.15) 0%, transparent 50%);
    pointer-events: none;
}
.canvas-promo-section * { position: relative; z-index: 1; }

.canvas-promo-badge {
    background: linear-gradient(135deg, #047857, #0369a1) !important;
    color: #fff !important;
    font-weight: 700;
    border: none !important;
}

/* Card principal - mockup do editor */
.canvas-promo-card-main {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.canvas-promo-card-main:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.canvas-promo-icon-lg {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #047857, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

/* =========================================
   FASE 2 — COMPONENTES PREMIUM MOBILE
   ========================================= */

/* --- Tipografia mobile hierárquica --- */
@media screen and (max-width: 768px) {
    .app-tab-content h5,
    .app-tab-content h5.fw-bold {
        font-size: 1.05rem;
        font-weight: 800;
        letter-spacing: -0.2px;
    }

    .app-tab-content h6,
    .app-tab-content .section-title {
        font-size: 0.82rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: #64748b;
    }

    .app-tab-content p,
    .app-tab-content .small {
        font-size: 0.88rem;
        line-height: 1.5;
    }

    /* Inputs com área de toque mínima 44px */
    .app-tab-content .form-control,
    .app-tab-content .form-select {
        min-height: 44px;
        border-radius: 12px !important;
        border: 1.5px solid #e2e8f0;
        font-size: 0.92rem;
        padding: 0.6rem 0.85rem;
        transition: border-color 0.18s, box-shadow 0.18s;
    }

    .app-tab-content .form-control:focus,
    .app-tab-content .form-select:focus {
        border-color: #047857;
        box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.14);
        outline: none;
    }

    .app-tab-content .form-control.is-invalid,
    .app-tab-content .form-select.is-invalid {
        border-color: #ef4444;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
    }

    .app-tab-content .form-control.is-valid,
    .app-tab-content .form-select.is-valid {
        border-color: #10b981;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
    }

    /* Botões com área de toque mínima */
    .app-tab-content .btn {
        min-height: 44px;
        border-radius: 12px !important;
        font-weight: 700;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
        transition: transform 0.12s, box-shadow 0.12s, background 0.18s;
    }

    .app-tab-content .btn:active {
        transform: scale(0.97);
    }

    .app-tab-content .btn-sm {
        min-height: 36px;
        font-size: 0.82rem;
        padding: 0.4rem 0.75rem;
    }

    /* Botão primário premium */
    .app-tab-content .btn-primary {
        background: linear-gradient(135deg, #047857 0%, #0369a1 100%);
        border: none;
        box-shadow: 0 4px 12px rgba(4, 120, 87, 0.28);
    }

    .app-tab-content .btn-primary:hover,
    .app-tab-content .btn-primary:focus {
        background: linear-gradient(135deg, #065f46 0%, #075985 100%);
        box-shadow: 0 6px 16px rgba(4, 120, 87, 0.38);
    }

    /* Botão sucesso */
    .app-tab-content .btn-success {
        background: linear-gradient(135deg, #10b981 0%, #047857 100%);
        border: none;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
    }

    /* Botão perigo */
    .app-tab-content .btn-danger {
        background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
        border: none;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.22);
    }

    /* Chips / badges de status */
    .app-tab-content .badge {
        border-radius: 8px;
        font-size: 0.72rem;
        font-weight: 700;
        padding: 0.3em 0.65em;
    }

    /* Tabs de visualização (Rótulo / Custos / Editor) */
    .app-tab-content .btn-group .btn {
        min-height: 40px;
        font-size: 0.82rem;
        border-radius: 10px !important;
    }

    /* Cards de seção com espaçamento 8pt */
    .app-tab-content .glass-card,
    .app-tab-content .card {
        border-radius: 16px !important;
        border: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        margin-bottom: 12px;
    }

    /* Seção de ingredientes mais compacta */
    .app-tab-content #listaIngredientesUI td {
        padding: 0.45rem 0.5rem;
        font-size: 0.82rem;
    }

    /* Alertas menores */
    .app-tab-content .alert {
        border-radius: 12px;
        font-size: 0.85rem;
        padding: 0.65rem 0.9rem;
    }
}

/* --- Identidade premium: gradiente nos cards de ação rápida --- */
.quick-action {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.1rem 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.quick-action:active {
    transform: scale(0.97);
}

.quick-action:hover {
    border-color: #047857;
    background: linear-gradient(145deg, #f0fdf4 0%, #ecfdf5 100%);
    box-shadow: 0 4px 14px rgba(4, 120, 87, 0.14);
    color: inherit;
}

/* --- Dash cards com identidade premium --- */
.dash-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 0.18s, box-shadow 0.18s;
}

.dash-card:active {
    transform: scale(0.98);
}

/* --- Recipe items com identidade premium --- */
.recipe-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.18s, border-color 0.18s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.recipe-item:active {
    border-color: #047857;
    box-shadow: 0 2px 10px rgba(4, 120, 87, 0.12);
}

/* =========================================
   FASE 4 — MICROINTERAÇÕES E ACESSIBILIDADE
   ========================================= */

/* --- Transições globais suaves --- */
.app-tab-panel {
    animation: tabFadeIn 0.22s ease-out;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Skeleton loader para listas --- */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.skeleton-line.short { width: 55%; }
.skeleton-line.medium { width: 75%; }
.skeleton-line.full { width: 100%; }

/* --- Estado vazio orientativo --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.4rem;
}

.empty-state-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

/* --- Feedback tátil: ripple em botões --- */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.25);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-ripple:active::after {
    opacity: 1;
    transition: opacity 0s;
}

/* --- Acessibilidade: foco visível --- */
:focus-visible {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #047857;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.18);
}

/* --- Acessibilidade: área de toque mínima 44px para todos os botões de ação --- */
.app-bottom-nav .tab-btn,
.app-sidebar .tab-btn,
.nutri-mascot-toggle,
.app-credit-pill {
    min-width: 44px;
    min-height: 44px;
}

/* --- Contraste de texto em superfícies escuras --- */
.app-tab-content .text-muted {
    color: #64748b !important;
}

/* --- Modo de alto contraste (prefers-contrast) --- */
@media (prefers-contrast: high) {
    .app-header {
        background: #000 !important;
    }

    .app-sidebar {
        background: #fff !important;
        border-right: 2px solid #000 !important;
    }

    .app-bottom-nav {
        background: #fff !important;
        border-top: 2px solid #000 !important;
    }

    .app-bottom-nav .tab-btn.active,
    .app-sidebar .tab-btn.active {
        color: #000 !important;
    }

    .form-control,
    .form-select {
        border: 2px solid #000 !important;
    }
}

/* --- Redução de movimento --- */
@media (prefers-reduced-motion: reduce) {
    .app-tab-panel,
    .dash-card,
    .quick-action,
    .recipe-item,
    .btn,
    .nutri-mascot-toggle {
        animation: none !important;
        transition: none !important;
    }
}

/* Mockup do editor */
.canvas-promo-mockup {
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}
.canvas-mockup-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}
.mockup-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.75rem;
    transition: all 0.2s;
}
.mockup-btn.active {
    background: #047857;
    color: #fff;
}
.mockup-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    margin: 0 4px;
}
.canvas-mockup-area {
    position: relative;
    height: 180px;
    background: repeating-conic-gradient(#1e1e32 0% 25%, #16162a 0% 50%) 50%/20px 20px;
    padding: 16px;
}
.mockup-element {
    position: absolute;
    border: 2px dashed rgba(4,120,87,0.6);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 0.6rem;
    padding: 6px;
    background: rgba(0,0,0,0.4);
}
.mockup-logo {
    top: 12px;
    left: 16px;
    width: 70px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.mockup-table {
    top: 12px;
    right: 16px;
    width: 120px;
    padding: 8px;
    font-family: monospace;
}
.mockup-text {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
    border-color: rgba(3,105,161,0.6);
    white-space: nowrap;
}
.mockup-handles {
    position: absolute;
    top: 10px;
    left: 14px;
    width: 74px;
    height: 54px;
    border: 2px solid #047857;
    border-radius: 6px;
    pointer-events: none;
}
.mockup-handles::before,
.mockup-handles::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #047857;
    border-radius: 2px;
}
.mockup-handles::before { top: -5px; left: -5px; }
.mockup-handles::after { bottom: -5px; right: -5px; }

.canvas-promo-tag {
    background: rgba(4,120,87,0.2) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(4,120,87,0.3) !important;
    font-weight: 600;
    font-size: 0.7rem;
}

/* Card IA */
.canvas-promo-card-ai {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.canvas-promo-card-ai:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
.canvas-promo-icon-ai {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}
.canvas-promo-ai-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
}
.ai-demo-before,
.ai-demo-after {
    text-align: center;
    position: relative;
}
.ai-demo-img {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}
.ai-demo-before .ai-demo-img {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}
.ai-demo-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #fca5a5 25%, #fcd34d 50%, #86efac 75%);
    opacity: 0.2;
    border-radius: 10px;
}
.ai-demo-after .ai-demo-img {
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50%/12px 12px;
    border: 2px solid #047857;
}
.ai-demo-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
}
.ai-demo-arrow {
    font-size: 1.8rem;
    color: #7c3aed;
    animation: aiArrowPulse 2s ease-in-out infinite;
}
@keyframes aiArrowPulse {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(6px); opacity: 0.6; }
}
.canvas-promo-ai-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.ai-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #047857;
    animation: pulse 2s ease-in-out infinite;
}

/* Mini features grid */
.canvas-feature-mini {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    color: #e2e8f0;
    transition: all 0.3s ease;
}
.canvas-feature-mini:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-3px);
}
.canvas-feature-mini i {
    font-size: 1.5rem;
    color: #6ee7b7;
}

/* CTA do editor */
.canvas-promo-cta {
    background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 14px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}
.canvas-promo-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(4,120,87,0.4) !important;
}

/* Responsivo */
@media (max-width: 768px) {
    .canvas-mockup-area { height: 150px; }
    .mockup-table { width: 100px; }
    .ai-demo-img { width: 70px; height: 70px; }
    .canvas-promo-section h2 { font-size: 1.8rem !important; }
    .canvas-feature-mini small.text-white-50 { display: none; }
}

/* =========================================
   PREVIEW DE DOWNLOAD / IMPRESSÃO (MOBILE)
   ========================================= */
#modalPreviewDownload .modal-dialog {
    max-width: 1120px;
    width: min(1120px, calc(100vw - 1.25rem));
}

/* Em telas < md: modal quase tela cheia + corpo rolável + rodapé fixo */
@media (max-width: 767.98px) {
    #modalPreviewDownload .modal-preview-download-dialog.modal-fullscreen-md-down {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
    }
    #modalPreviewDownload .h-100-md-down {
        height: 100%;
        max-height: 100dvh;
        min-height: 0;
        border-radius: 0 !important;
    }
    #modalPreviewDownload .min-h-0-modal-body {
        min-height: 0;
        flex: 1 1 auto;
    }
}

#modalPreviewDownload .modal-content {
    border-radius: 1.5rem;
    overflow: hidden;
    border: 0;
}

@media (min-width: 768px) {
    #modalPreviewDownload .h-100-md-down {
        height: auto;
        max-height: none;
    }
}

/* Imagem da prévia: só CSS (JS não força inline) */
#previewImage.preview-download-img,
img#previewImage.preview-download-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    border-radius: 0.75rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    max-height: min(420px, 58vh);
}

#modalPreviewDownload .modal-header {
    padding: 1rem 1.25rem;
}

#modalPreviewDownload .modal-body {
    padding: 1.25rem;
}

#modalPreviewDownload .modal-footer {
    padding: 1rem 1.25rem;
    background: #fff;
}

#previewLoading {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#previewImageContainer {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 1rem;
    border-radius: 1rem !important;
    max-height: min(58vh, 520px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

#previewInfoContainer .row > [class*="col-"] > div {
    height: 100%;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

#previewInfoContainer .bg-light,
#previewInfoContainer .bg-success {
    border-radius: 14px !important;
}

#previewInfoContainer .fw-bold {
    word-break: break-word;
}

#previewInfoContainer .text-truncate {
    max-width: 100%;
}

#previewReimpressaoAviso {
    border-radius: 0.85rem;
}

@media (max-width: 767.98px) {
    /* Dialog sem fullscreen (fallback) — hoje sempre usamos modal-fullscreen-md-down */
    #modalPreviewDownload .modal-dialog:not(.modal-fullscreen-md-down) {
        width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    #modalPreviewDownload .modal-content {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    #modalPreviewDownload .modal-body {
        padding: 0.85rem 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #previewLoading {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        min-height: 160px;
    }

    #previewImageContainer {
        padding: 0.5rem;
        max-height: min(42dvh, 320px);
        min-height: 120px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8fafc !important;
    }

    #previewImage.preview-download-img,
    img#previewImage.preview-download-img {
        max-width: 100% !important;
        max-height: min(38dvh, 280px) !important;
        border-radius: 8px;
    }

    #previewInfoContainer .row {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    #previewInfoContainer .col-6 {
        width: 100%;
    }

    #previewInfoContainer .p-3 {
        padding: 0.9rem !important;
    }

    #previewNomeProduto,
    #previewFormato {
        font-size: 0.95rem;
        line-height: 1.25;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    #previewCreditos {
        font-size: 0.95rem;
    }

    #previewFormatoDesc,
    #previewInfoContainer small {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    #modalPreviewDownload .modal-footer.preview-download-footer,
    #modalPreviewDownload .preview-download-footer {
        padding: 0.75rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    #modalPreviewDownload .preview-download-footer .btn {
        min-height: 48px;
    }
}

@media (max-width: 420px) {
    #modalPreviewDownload .modal-header,
    #modalPreviewDownload .preview-download-footer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    #modalPreviewDownload .modal-body {
        padding: 0.75rem !important;
    }

    #previewImageContainer {
        max-height: min(40dvh, 260px);
        min-height: 100px;
    }

    #previewImage.preview-download-img,
    img#previewImage.preview-download-img {
        max-height: min(36dvh, 220px) !important;
    }
}

/* Prévia do rótulo na aba (mobile): evita estourar a largura da tela */
@media (max-width: 991.98px) {
    #tab-rotulo #previewArea {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #tab-rotulo #previewArea #rotuloCompleto {
        min-width: 0;
    }
}
