/* =====================================================
   SuperMarketPro - Design System
   Paleta inspirada no logo: azul marinho, verde, azul
   ===================================================== */

:root {
    /* Cores principais (do logo) */
    --azul-marinho: #0F2C5C;
    --azul-marinho-claro: #1E3D7A;
    --verde: #28A745;
    --verde-claro: #34CE57;
    --verde-escuro: #1E8838;
    --azul: #1E88E5;
    --azul-claro: #42A5F5;
    
    /* Gradientes */
    --grad-principal: linear-gradient(135deg, #28A745 0%, #1E88E5 100%);
    --grad-azul: linear-gradient(135deg, #0F2C5C 0%, #1E88E5 100%);
    --grad-verde: linear-gradient(135deg, #1E8838 0%, #28A745 100%);
    --grad-sutil: linear-gradient(135deg, rgba(40,167,69,0.06) 0%, rgba(30,136,229,0.06) 100%);
    
    /* Cinzas */
    --bg: #F7F8FC;
    --bg-card: #FFFFFF;
    --bg-elevado: #FFFFFF;
    --borda: #E8ECEF;
    --borda-clara: #F0F3F6;
    --texto: #1A2332;
    --texto-suave: #5A6675;
    --texto-claro: #97A1B0;
    
    /* Estados */
    --sucesso: #28A745;
    --erro: #DC3545;
    --aviso: #FFC107;
    --info: #1E88E5;
    
    /* Sombras */
    --sombra-sm: 0 1px 2px rgba(15, 44, 92, 0.04), 0 1px 3px rgba(15, 44, 92, 0.06);
    --sombra-md: 0 4px 6px -1px rgba(15, 44, 92, 0.06), 0 2px 4px -1px rgba(15, 44, 92, 0.04);
    --sombra-lg: 0 10px 25px -5px rgba(15, 44, 92, 0.08), 0 8px 10px -6px rgba(15, 44, 92, 0.04);
    --sombra-xl: 0 25px 50px -12px rgba(15, 44, 92, 0.15);
    --sombra-marca: 0 8px 24px rgba(40, 167, 69, 0.25);
    
    /* Tipografia */
    --fonte-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    --fonte-corpo: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Espaçamento */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Layout */
    --header-altura: 64px;
    --nav-altura: 72px;
    --max-largura: 720px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--fonte-corpo);
    color: var(--texto);
    background: var(--bg);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: 16px;
    color: var(--texto);
}

/* =====================================================
   SPLASH SCREEN
   ===================================================== */
.splash {
    position: fixed;
    inset: 0;
    background: var(--grad-azul);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-logo {
    animation: float 2s ease-in-out infinite;
    margin-bottom: 24px;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.3));
}

.splash-title {
    font-family: var(--fonte-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 32px;
}

.splash-title span {
    color: var(--verde-claro);
}

.splash-loader {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}

.splash-loader::before {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 2px;
    animation: loader 1.2s ease-in-out infinite;
}

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

@keyframes loader {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* =====================================================
   TELA DE LOGIN
   ===================================================== */
.tela-login {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #F0F7FF 0%, #EBF5EF 100%);
    z-index: -1;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.login-orb-1 {
    width: 320px; height: 320px;
    background: var(--verde);
    top: -80px; right: -80px;
    animation: orbFloat 8s ease-in-out infinite;
}

.login-orb-2 {
    width: 280px; height: 280px;
    background: var(--azul);
    bottom: -80px; left: -80px;
    animation: orbFloat 10s ease-in-out infinite reverse;
}

.login-orb-3 {
    width: 200px; height: 200px;
    background: var(--azul-marinho);
    top: 40%; left: 50%;
    opacity: 0.15;
    animation: orbFloat 12s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    z-index: 1;
}

.login-card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    box-shadow: var(--sombra-xl);
    animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: inline-block;
    margin-bottom: 16px;
    filter: drop-shadow(0 8px 20px rgba(30, 136, 229, 0.25));
}

.login-title {
    font-family: var(--fonte-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--azul-marinho);
    margin-bottom: 4px;
}

.login-title span {
    color: var(--verde);
}

.login-subtitle {
    color: var(--texto-suave);
    font-size: 14px;
    font-weight: 500;
}

.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--texto-suave);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    background: white;
    border: 1.5px solid var(--borda);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.1);
}

.btn-primary {
    background: var(--grad-principal);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    box-shadow: var(--sombra-marca);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(40, 167, 69, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-secundario {
    background: white;
    color: var(--azul-marinho);
    padding: 12px 20px;
    border: 1.5px solid var(--borda);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-secundario:hover {
    border-color: var(--azul);
    color: var(--azul);
}

.erro-mensagem {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(220, 53, 69, 0.08);
    color: var(--erro);
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-align: center;
    display: none;
}

.erro-mensagem.visivel {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.acesso-teste {
    text-align: center;
}

.divisor {
    display: flex;
    align-items: center;
    margin: 20px 0 16px;
    color: var(--texto-claro);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divisor::before,
.divisor::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--borda);
}

.divisor span {
    padding: 0 12px;
}

.teste-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.btn-teste {
    background: white;
    border: 1.5px solid var(--borda);
    border-radius: var(--radius-md);
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-teste:hover {
    border-color: var(--verde);
    background: rgba(40, 167, 69, 0.04);
    transform: translateY(-2px);
}

.teste-icon {
    font-size: 22px;
}

.teste-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--texto-suave);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.teste-info {
    font-size: 12px;
    color: var(--texto-claro);
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--texto-claro);
}

/* =====================================================
   APP - HEADER
   ===================================================== */
.app {
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-altura) + env(safe-area-inset-bottom));
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--borda-clara);
    height: var(--header-altura);
}

.header-content {
    max-width: var(--max-largura);
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title {
    font-family: var(--fonte-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--azul-marinho);
    letter-spacing: -0.3px;
}

.header-title strong {
    color: var(--verde);
    font-weight: 800;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--grad-principal);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* =====================================================
   CONTEÚDO
   ===================================================== */
.conteudo {
    max-width: var(--max-largura);
    margin: 0 auto;
    padding: 24px 20px;
    animation: fadeIn 0.3s ease;
}

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

.pagina-titulo {
    font-family: var(--fonte-display);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--azul-marinho);
    margin-bottom: 4px;
}

.pagina-subtitulo {
    color: var(--texto-suave);
    font-size: 14px;
    margin-bottom: 24px;
}

.secao {
    margin-bottom: 32px;
}

.secao-titulo {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--texto-claro);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* =====================================================
   HOME / DASHBOARD CARDS
   ===================================================== */
.welcome-card {
    background: var(--grad-azul);
    color: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 160px;
    height: 160px;
    background: rgba(40, 167, 69, 0.3);
    border-radius: 50%;
    filter: blur(40px);
}

.welcome-saudacao {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 500;
    margin-bottom: 4px;
    position: relative;
}

.welcome-nome {
    font-family: var(--fonte-display);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
}

.welcome-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    position: relative;
}

.welcome-stat {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    padding: 14px;
}

.welcome-stat-label {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.welcome-stat-valor {
    font-family: var(--fonte-display);
    font-size: 22px;
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--sombra-sm);
    border: 1px solid var(--borda-clara);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-md);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: white;
}

.stat-icon.verde { background: var(--grad-verde); }
.stat-icon.azul { background: linear-gradient(135deg, var(--azul) 0%, var(--azul-claro) 100%); }
.stat-icon.roxo { background: linear-gradient(135deg, #8E44AD 0%, #A569BD 100%); }
.stat-icon.laranja { background: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%); }

.stat-label {
    font-size: 12px;
    color: var(--texto-suave);
    font-weight: 500;
    margin-bottom: 2px;
}

.stat-valor {
    font-family: var(--fonte-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--azul-marinho);
    letter-spacing: -0.5px;
}

/* =====================================================
   LISTAS
   ===================================================== */
.lista-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--sombra-sm);
    border: 1px solid var(--borda-clara);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.lista-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-md);
    border-color: var(--verde);
}

.lista-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--grad-principal);
}

.lista-card.finalizada::before {
    background: var(--texto-claro);
    opacity: 0.5;
}

.lista-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.lista-card-nome {
    font-family: var(--fonte-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--azul-marinho);
    margin-bottom: 2px;
}

.lista-card-mercado {
    font-size: 12px;
    color: var(--texto-suave);
}

.lista-status {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lista-status.ativa {
    background: rgba(40, 167, 69, 0.1);
    color: var(--verde-escuro);
}

.lista-status.finalizada {
    background: rgba(108, 117, 125, 0.1);
    color: var(--texto-suave);
}

.lista-progresso {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.barra-progresso {
    flex: 1;
    height: 6px;
    background: var(--borda-clara);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.barra-progresso-fill {
    height: 100%;
    background: var(--grad-principal);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.lista-info {
    font-size: 12px;
    color: var(--texto-suave);
    font-weight: 600;
    white-space: nowrap;
}

.lista-totais {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--borda);
    font-size: 13px;
}

.lista-totais span {
    color: var(--texto-suave);
}

.lista-totais strong {
    color: var(--azul-marinho);
    font-weight: 700;
}

/* =====================================================
   ITENS DA LISTA
   ===================================================== */
.lista-detalhe-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--sombra-sm);
    border: 1px solid var(--borda-clara);
}

.detalhe-totais-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.detalhe-total {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.detalhe-total-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--texto-suave);
    font-weight: 700;
    margin-bottom: 4px;
}

.detalhe-total-valor {
    font-family: var(--fonte-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--azul-marinho);
}

.detalhe-total-valor.verde { color: var(--verde-escuro); }
.detalhe-total-valor.azul { color: var(--azul); }

.categoria-grupo {
    margin-bottom: 16px;
}

.categoria-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.categoria-bolinha {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.categoria-nome {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--texto-suave);
}

.item-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 6px;
    box-shadow: var(--sombra-sm);
    border: 1px solid var(--borda-clara);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.item-card.comprado {
    opacity: 0.55;
    background: var(--bg);
}

.item-card.comprado .item-nome {
    text-decoration: line-through;
    color: var(--texto-suave);
}

.item-checkbox {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    border: 2px solid var(--borda);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.item-checkbox.marcado {
    background: var(--verde);
    border-color: var(--verde);
}

.item-checkbox.marcado::after {
    content: '✓';
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-nome {
    font-weight: 600;
    color: var(--texto);
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-detalhes {
    font-size: 12px;
    color: var(--texto-suave);
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-preco {
    text-align: right;
    font-family: var(--fonte-display);
    font-weight: 700;
    color: var(--azul-marinho);
    font-size: 14px;
    white-space: nowrap;
}

.item-preco-real {
    color: var(--verde-escuro);
}

.item-acoes {
    display: flex;
    gap: 4px;
}

.btn-acao-item {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texto-suave);
    transition: all 0.2s ease;
}

.btn-acao-item:hover {
    background: var(--bg);
    color: var(--azul);
}

.btn-acao-item.deletar:hover {
    color: var(--erro);
    background: rgba(220, 53, 69, 0.08);
}

/* =====================================================
   NAVEGAÇÃO INFERIOR
   ===================================================== */
.nav-inferior {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--borda-clara);
    height: var(--nav-altura);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    max-width: var(--max-largura);
    margin: 0 auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -8px 32px rgba(15, 44, 92, 0.08);
}

.nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--texto-claro);
    font-size: 11px;
    font-weight: 600;
    transition: color 0.2s ease;
    position: relative;
}

.nav-item.ativo {
    color: var(--verde);
}

.nav-item.ativo svg {
    transform: scale(1.1);
}

.nav-item svg {
    transition: transform 0.2s ease;
}

.nav-fab {
    flex: 0 0 auto;
    height: auto;
    margin-top: -28px;
}

.fab-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--grad-principal);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
    transition: all 0.2s ease;
}

.fab-button:hover {
    transform: scale(1.05) rotate(90deg);
}

.nav-fab span {
    display: none;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 640px) {
    .modal {
        align-items: center;
    }
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 44, 92, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
    .modal-content {
        border-radius: var(--radius-xl);
        max-height: 85vh;
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--borda-clara);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h3 {
    font-family: var(--fonte-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--azul-marinho);
}

.btn-fechar-modal {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--texto-suave);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-fechar-modal:hover {
    background: var(--erro);
    color: white;
}

.modal-corpo {
    padding: 24px;
}

/* =====================================================
   TOAST
   ===================================================== */
.toast-container {
    position: fixed;
    bottom: calc(var(--nav-altura) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--azul-marinho);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--sombra-lg);
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    max-width: 320px;
}

.toast.sucesso { background: var(--verde-escuro); }
.toast.erro { background: var(--erro); }
.toast.aviso { background: #B8860B; }

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

.toast.fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to { transform: translateY(20px); opacity: 0; }
}

/* =====================================================
   ESTADOS VAZIOS
   ===================================================== */
.estado-vazio {
    text-align: center;
    padding: 48px 24px;
}

.estado-vazio-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--grad-sutil);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.estado-vazio-titulo {
    font-family: var(--fonte-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--azul-marinho);
    margin-bottom: 6px;
}

.estado-vazio-texto {
    color: var(--texto-suave);
    font-size: 14px;
    margin-bottom: 20px;
}

/* =====================================================
   GRÁFICOS
   ===================================================== */
.grafico-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--sombra-sm);
    border: 1px solid var(--borda-clara);
}

.grafico-titulo {
    font-family: var(--fonte-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--azul-marinho);
    margin-bottom: 16px;
}

.barras-mensal {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 160px;
    padding-top: 16px;
}

.barra-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.barra-valor {
    font-size: 10px;
    font-weight: 700;
    color: var(--texto-suave);
}

.barra-rect {
    width: 100%;
    background: var(--grad-principal);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-height: 4px;
    transition: all 0.4s ease;
    position: relative;
}

.barra-label {
    font-size: 10px;
    color: var(--texto-suave);
    font-weight: 600;
    text-transform: uppercase;
}

.categoria-bar {
    margin-bottom: 12px;
}

.categoria-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.categoria-bar-nome {
    color: var(--texto);
    font-weight: 600;
}

.categoria-bar-valor {
    color: var(--azul-marinho);
    font-weight: 700;
}

.categoria-bar-track {
    height: 8px;
    background: var(--borda-clara);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.categoria-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

/* =====================================================
   FORMS GERAIS
   ===================================================== */
.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions button {
    flex: 1;
}

/* =====================================================
   MENU
   ===================================================== */
.menu-item {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--borda-clara);
}

.menu-item:hover {
    transform: translateX(2px);
    border-color: var(--azul);
    background: var(--grad-sutil);
}

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--grad-sutil);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--azul);
    font-size: 18px;
}

.menu-texto {
    flex: 1;
}

.menu-titulo {
    font-weight: 600;
    color: var(--texto);
    font-size: 14px;
}

.menu-descricao {
    color: var(--texto-suave);
    font-size: 12px;
    margin-top: 2px;
}

.menu-seta {
    color: var(--texto-claro);
}

.usuario-perfil-box {
    background: var(--grad-azul);
    color: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.perfil-avatar-grande {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fonte-display);
    font-size: 24px;
    font-weight: 800;
    border: 2px solid rgba(255,255,255,0.3);
}

.perfil-nome {
    font-family: var(--fonte-display);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.perfil-email {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.perfil-nivel {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(40, 167, 69, 0.3);
    border: 1px solid rgba(40, 167, 69, 0.5);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================
   USUÁRIOS (ADMIN)
   ===================================================== */
.usuario-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 8px;
    border: 1px solid var(--borda-clara);
    display: flex;
    align-items: center;
    gap: 12px;
}

.usuario-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad-principal);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.usuario-info {
    flex: 1;
}

.usuario-nome {
    font-weight: 600;
    font-size: 14px;
    color: var(--texto);
}

.usuario-email {
    font-size: 12px;
    color: var(--texto-suave);
}

.usuario-nivel-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usuario-nivel-badge.operador {
    background: rgba(30, 136, 229, 0.1);
    color: var(--azul);
}

.usuario-nivel-badge.admin {
    background: rgba(255, 152, 0, 0.1);
    color: #E65100;
}

.usuario-nivel-badge.superadmin {
    background: rgba(142, 68, 173, 0.1);
    color: #6A1B9A;
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

.btn-danger {
    background: var(--erro);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* Responsividade desktop */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .welcome-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Scroll customizado */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--borda);
    border-radius: 3px;
}

/* ============================================
   v2.0.0 - Estilos novos
   ============================================ */

/* Sino de notificações */
.btn-icon { position: relative; }
.badge-sino-header {
    position: absolute; top: -4px; right: -4px;
    background: var(--erro); color: white;
    font-size: 10px; font-weight: 700;
    border-radius: 10px;
    min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
}

.botao-sino {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    position: relative; padding: 8px;
}
.badge-sino {
    position: absolute; top: 0; right: 0;
    background: var(--erro); color: white;
    font-size: 10px; font-weight: 700;
    border-radius: 10px;
    min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Modo de lista (planejada/rápida) */
.modo-cards {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 20px;
}
.modo-card {
    border: 2px solid var(--borda);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}
.modo-card:hover { border-color: var(--verde); }
.modo-card.selecionado {
    border-color: var(--verde);
    background: linear-gradient(135deg, rgba(40,167,69,0.08), rgba(30,136,229,0.08));
    box-shadow: 0 2px 8px rgba(40,167,69,0.2);
}
.modo-card-icone { font-size: 36px; margin-bottom: 6px; }
.modo-card-titulo {
    font-weight: 700; color: var(--azul-marinho);
    margin-bottom: 4px; font-size: 15px;
}
.modo-card-desc {
    font-size: 11px; color: var(--texto-suave); line-height: 1.4;
}

/* Botões de adicionar item (4 modos) */
.botoes-adicionar-item {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px; margin: 16px 0;
}
.btn-add-modo {
    background: white; border: 1.5px solid var(--borda);
    border-radius: var(--radius-md);
    padding: 12px 4px;
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    cursor: pointer; transition: all 0.2s;
    color: var(--texto);
}
.btn-add-modo:hover {
    border-color: var(--azul);
    background: rgba(30,136,229,0.05);
}
.btn-add-modo .add-emoji { font-size: 24px; }
.btn-add-modo .add-label { font-size: 11px; font-weight: 600; }

/* Resumo da lista */
.resumo-lista {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; background: white;
    padding: 12px; border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.resumo-item { text-align: center; }
.resumo-valor {
    font-size: 16px; font-weight: 700;
    color: var(--azul-marinho);
    font-family: 'Outfit', sans-serif;
}
.resumo-label {
    font-size: 11px; color: var(--texto-suave);
    margin-top: 2px;
}

/* Itens da lista */
.itens-lista { display: flex; flex-direction: column; gap: 8px; }
.item-card {
    display: flex; align-items: center;
    background: white; border-radius: var(--radius-md);
    padding: 12px; gap: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.item-card.comprado {
    opacity: 0.6; background: var(--bg);
}
.item-card.comprado .item-nome { text-decoration: line-through; }

.item-checkbox { flex-shrink: 0; }
.checkbox-redondo {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2.5px solid var(--borda);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
    color: transparent; font-weight: 700; font-size: 14px;
    background: white;
}
.checkbox-redondo.check {
    background: var(--verde); border-color: var(--verde);
    color: white;
}

.item-corpo { flex: 1; cursor: pointer; min-width: 0; }
.item-nome {
    font-weight: 600; color: var(--azul-marinho);
    font-size: 14px; display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap;
}
.item-info {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 4px; font-size: 11px; color: var(--texto-suave);
    align-items: center;
}
.item-qtd { font-weight: 600; }
.item-cat {
    padding: 2px 6px; border-radius: 6px; font-weight: 600;
}
.item-valor { text-align: right; flex-shrink: 0; }
.item-preco {
    font-weight: 700; color: var(--azul-marinho); font-size: 14px;
}
.item-desconto {
    font-size: 11px; color: var(--verde); font-weight: 600;
}

/* Badges */
.badge-promo {
    background: linear-gradient(135deg, #FF9800, #F44336);
    color: white; font-size: 10px; font-weight: 700;
    padding: 2px 6px; border-radius: 6px;
    letter-spacing: 0.5px;
}
.badge-validade {
    padding: 2px 6px; border-radius: 6px;
    font-size: 10px; font-weight: 600;
}
.badge-validade.validade-ok { background: rgba(40,167,69,0.15); color: var(--verde); }
.badge-validade.validade-atencao { background: rgba(255,193,7,0.15); color: #b78600; }
.badge-validade.validade-proximo { background: rgba(255,152,0,0.18); color: #d84315; }
.badge-validade.validade-vencido { background: rgba(220,53,69,0.15); color: var(--erro); }

/* Botão ícone (scanner no form de item) */
.btn-icone {
    background: var(--bg); border: 1.5px solid var(--borda);
    border-radius: var(--radius-md);
    padding: 0 14px; font-size: 18px;
    cursor: pointer; transition: all 0.2s;
}
.btn-icone:hover { background: var(--azul); color: white; border-color: var(--azul); }

/* Dispensa */
.filtros-tabs {
    display: flex; gap: 4px;
    overflow-x: auto; padding: 4px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--borda);
}
.filtro-tab {
    background: none; border: none;
    padding: 8px 14px; font-size: 13px;
    color: var(--texto-suave); font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.filtro-tab.ativo {
    color: var(--verde); border-bottom-color: var(--verde);
}

.dispensa-itens { display: flex; flex-direction: column; gap: 8px; }
.dispensa-card {
    background: white; border-radius: var(--radius-md);
    padding: 12px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.dispensa-corpo { flex: 1; min-width: 0; }
.dispensa-nome {
    font-weight: 600; color: var(--azul-marinho); font-size: 14px;
}
.dispensa-info {
    font-size: 11px; color: var(--texto-suave); margin-top: 2px;
}
.dispensa-status {
    font-weight: 700; font-size: 12px;
    text-align: right; white-space: nowrap;
}
.dispensa-acoes {
    display: flex; gap: 4px; margin-left: 8px;
}
.dispensa-acoes button {
    width: 32px; height: 32px;
    background: var(--bg); border: 1px solid var(--borda);
    border-radius: 50%;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.dispensa-acoes button:hover { background: var(--verde); color: white; border-color: var(--verde); }

/* Notificações */
.notif-lista { display: flex; flex-direction: column; gap: 8px; }
.notif-card {
    background: white; border-radius: var(--radius-md);
    padding: 12px; display: flex; gap: 12px;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    border-left: 3px solid transparent;
}
.notif-card.nova {
    border-left-color: var(--azul);
    background: linear-gradient(90deg, rgba(30,136,229,0.05), white);
}
.notif-icone {
    font-size: 24px; width: 44px; height: 44px;
    background: var(--bg); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notif-corpo { flex: 1; min-width: 0; }
.notif-titulo {
    font-weight: 700; color: var(--azul-marinho); font-size: 14px;
}
.notif-mensagem {
    font-size: 13px; color: var(--texto); margin-top: 2px;
}
.notif-tempo {
    font-size: 11px; color: var(--texto-suave); margin-top: 4px;
}

/* Preview de itens (parser) */
.preview-item {
    display: flex; gap: 6px; padding: 8px;
    border-bottom: 1px solid var(--borda); align-items: center;
}
.preview-item input, .preview-item select {
    font-size: 13px;
}
.preview-check { width: 20px; height: 20px; cursor: pointer; }

/* Menu opções de lista */
.menu-opcoes { display: flex; flex-direction: column; gap: 4px; }
.menu-opcao {
    background: none; border: none;
    padding: 14px 12px; text-align: left;
    font-size: 14px; color: var(--texto);
    border-radius: var(--radius-md);
    cursor: pointer; transition: background 0.2s;
}
.menu-opcao:hover { background: var(--bg); }
.menu-opcao.danger { color: var(--erro); }

/* Ações rodapé (finalizar) */
.acoes-rodape {
    position: sticky; bottom: 80px;
    margin-top: 16px;
    padding: 12px; background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}
.btn-bloco { width: 100%; }

/* Botões rápidos no dashboard */
.botoes-rapidos {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.botao-rapido {
    background: white; border: 1.5px solid var(--borda);
    border-radius: var(--radius-md);
    padding: 14px 8px; display: flex;
    flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; transition: all 0.2s;
    color: var(--texto); font-size: 12px; font-weight: 600;
}
.botao-rapido:hover { border-color: var(--verde); transform: translateY(-2px); }
.botao-rapido .emoji { font-size: 24px; }

/* Vazio estado */
.vazio-estado {
    text-align: center; padding: 48px 24px;
}
.vazio-emoji { font-size: 64px; margin-bottom: 12px; }
.vazio-estado h3 {
    color: var(--azul-marinho); margin-bottom: 8px;
}
.vazio-estado p {
    color: var(--texto-suave); font-size: 13px; max-width: 280px;
    margin: 0 auto 16px;
}

/* Header de página com botão voltar */
.btn-voltar {
    background: none; border: none;
    font-size: 24px; cursor: pointer;
    color: var(--azul-marinho);
    padding: 4px 8px;
}
.botao-adicionar {
    width: 36px; height: 36px;
    border-radius: 50%; background: var(--verde);
    color: white; border: none;
    font-size: 22px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(40,167,69,0.3);
}
.botao-menu {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: var(--azul-marinho); padding: 4px 8px;
}

/* Cards Stats */
.cards-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 20px;
}
.card-stat {
    color: white; border-radius: var(--radius-md);
    padding: 16px; position: relative; overflow: hidden;
}
.card-stat-icone { font-size: 24px; margin-bottom: 6px; }
.card-stat-valor {
    font-size: 22px; font-weight: 700;
    font-family: 'Outfit', sans-serif;
}
.card-stat-label { font-size: 11px; opacity: 0.9; margin-top: 2px; }

.secao { margin-bottom: 24px; }
.secao h3 {
    font-size: 14px; color: var(--texto-suave);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Card padrão */
.card-padrao {
    background: white; border-radius: var(--radius-md);
    padding: 14px; display: flex; align-items: center;
    justify-content: space-between; gap: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    margin-bottom: 8px;
}
.card-acoes { display: flex; gap: 6px; }
.card-acoes button {
    background: none; border: none;
    font-size: 16px; padding: 6px; cursor: pointer;
    border-radius: 6px;
}
.card-acoes button:hover { background: var(--bg); }

/* Form campos */
.campo { margin-bottom: 14px; }
.campo label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--texto); margin-bottom: 4px;
}
.campo input, .campo select, .campo textarea {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--borda);
    border-radius: var(--radius-md);
    font-size: 14px; font-family: inherit;
    background: white;
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
    outline: none; border-color: var(--verde);
}
.campo-grupo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.campo-checkbox { margin-bottom: 14px; }
.campo-checkbox label {
    cursor: pointer; font-size: 14px; color: var(--texto);
}
.campo-checkbox input[type="checkbox"] {
    width: 18px; height: 18px; cursor: pointer;
}

.form-actions {
    display: flex; gap: 8px; margin-top: 16px;
}
.form-actions button { flex: 1; padding: 12px; }

.header-pagina {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 16px;
}
.header-pagina h2 {
    color: var(--azul-marinho); font-size: 22px;
    font-family: 'Outfit', sans-serif;
}
.header-pagina .subtitulo {
    color: var(--texto-suave); font-size: 12px;
    margin-top: 2px;
}

/* Spinner */
.carregando-tela {
    display: flex; justify-content: center;
    padding: 48px;
}
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--borda);
    border-top-color: var(--verde);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.erro-tela {
    text-align: center; padding: 48px;
    color: var(--erro);
}

/* Lista cards */
.lista-cards { display: flex; flex-direction: column; gap: 10px; }
.card-lista {
    background: white; border-radius: var(--radius-md);
    padding: 14px; cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.card-lista:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-lista-topo {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 8px;
}
.card-lista-nome {
    font-weight: 700; color: var(--azul-marinho); font-size: 15px;
}
.card-lista-mercado {
    font-size: 11px; color: var(--texto-suave); margin-top: 2px;
}
.card-lista-info {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--texto-suave);
    margin-bottom: 6px;
}
.barra-progresso {
    width: 100%; height: 4px; background: var(--bg);
    border-radius: 2px; overflow: hidden;
}
.barra-progresso-fill {
    height: 100%; background: linear-gradient(90deg, var(--verde), var(--azul));
    transition: width 0.3s;
}

.badge-status {
    font-size: 10px; font-weight: 700;
    padding: 3px 8px; border-radius: 8px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-ativa { background: rgba(40,167,69,0.15); color: var(--verde); }
.badge-finalizada { background: rgba(30,136,229,0.15); color: var(--azul); }
.badge-arquivada { background: rgba(108,117,125,0.15); color: #6c757d; }

/* ============================================
   v2.1 - Análises + Perfil
   ============================================ */

/* Opções de perfil (lista) */
.opcao-perfil {
    width: 100%;
    background: white;
    border: 1px solid var(--borda);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.opcao-perfil:hover {
    border-color: var(--azul);
    background: rgba(30,136,229,0.03);
    transform: translateX(2px);
}
.opcao-perfil:disabled {
    opacity: 0.5; cursor: not-allowed;
}
.opcao-icone {
    font-size: 22px;
    width: 40px; height: 40px;
    background: var(--bg);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.opcao-texto {
    flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.opcao-texto strong {
    color: var(--azul-marinho);
    font-size: 14px; font-weight: 600;
}
.opcao-texto small {
    color: var(--texto-suave);
    font-size: 12px;
}
.opcao-seta {
    color: var(--texto-suave);
    font-size: 20px;
    font-weight: 300;
}
.opcao-perigo strong { color: var(--erro); }
.opcao-instalar {
    background: linear-gradient(135deg, rgba(40,167,69,0.05), rgba(30,136,229,0.05));
    border-color: var(--verde);
}

/* Card resumo do mês (análises) */
.card-resumo-mes {
    background: linear-gradient(135deg, var(--azul-marinho), var(--azul));
    color: white;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(15,44,92,0.2);
}
.resumo-mes-titulo {
    font-size: 12px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.resumo-mes-valor {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 700;
    margin: 8px 0;
}
.resumo-mes-comparacao {
    font-size: 12px;
    opacity: 0.9;
}

/* Mini cards */
.mini-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.mini-card-icone { font-size: 22px; margin-bottom: 4px; }
.mini-card-valor {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--azul-marinho);
}
.mini-card-label {
    font-size: 10px;
    color: var(--texto-suave);
    margin-top: 2px;
}

/* Gráfico de barras (gastos por mês) */
.grafico-barras {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 6px;
    height: 180px;
    padding-top: 24px;
}
.barra-mes {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}
.barra-mes .barra {
    width: 100%;
    max-width: 32px;
    background: linear-gradient(180deg, var(--verde), var(--azul));
    border-radius: 6px 6px 0 0;
    transition: all 0.3s;
}
.barra-mes:hover .barra {
    background: linear-gradient(180deg, var(--azul), var(--azul-marinho));
}
.barra-valor {
    position: absolute;
    top: -4px;
    font-size: 9px;
    color: var(--texto-suave);
    font-weight: 600;
    white-space: nowrap;
}
.barra-label {
    font-size: 10px;
    color: var(--texto-suave);
    margin-top: 4px;
    font-weight: 600;
}

/* Categoria (barra horizontal) */
.cat-linha {
    margin-bottom: 12px;
}
.cat-linha:last-child { margin-bottom: 0; }
.cat-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}
.cat-nome { font-weight: 600; color: var(--azul-marinho); }
.cat-valor { color: var(--texto-suave); font-size: 12px; }
.cat-barra {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}
.cat-barra-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s;
}

/* Top itens */
.top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--borda);
}
.top-item:last-child { border-bottom: none; }
.top-rank {
    font-weight: 700;
    font-size: 14px;
    color: var(--azul);
    min-width: 36px;
}
.top-corpo { flex: 1; min-width: 0; }
.top-nome {
    font-weight: 600;
    color: var(--azul-marinho);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-info {
    font-size: 11px;
    color: var(--texto-suave);
    margin-top: 2px;
}

/* Card promo (resumo) */
.card-promo-resumo {
    background: linear-gradient(135deg, rgba(255,152,0,0.1), rgba(244,67,54,0.1));
    border: 1px solid rgba(255,152,0,0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.promo-icone {
    font-size: 32px;
    flex-shrink: 0;
}
.promo-titulo {
    font-weight: 700;
    color: var(--azul-marinho);
    font-size: 14px;
}
.promo-economia {
    font-size: 12px;
    color: var(--verde);
    margin-top: 2px;
    font-weight: 600;
}

/* ============================================
   v2.2 - Análises avançadas
   ============================================ */

/* Filtros */
.filtros-analise {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: white;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.filtro-grupo { display: flex; flex-direction: column; gap: 4px; }
.filtro-grupo label {
    font-size: 10px;
    color: var(--texto-suave);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.filtro-grupo select {
    padding: 8px 6px;
    border: 1px solid var(--borda);
    border-radius: 8px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

/* KPIs grid */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.kpi-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    border-left: 3px solid var(--azul);
}
.kpi-card.kpi-principal {
    background: linear-gradient(135deg, var(--azul-marinho), var(--azul));
    color: white;
    border-left: none;
    grid-column: span 2;
}
.kpi-card.kpi-promo {
    border-left-color: #FF9800;
}
.kpi-label {
    font-size: 10px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    color: var(--texto-suave);
}
.kpi-principal .kpi-label { color: rgba(255,255,255,0.85); }
.kpi-valor {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--azul-marinho);
    margin: 4px 0;
}
.kpi-principal .kpi-valor {
    color: white;
    font-size: 32px;
}
.kpi-detalhe {
    font-size: 11px;
    color: var(--texto-suave);
}
.kpi-principal .kpi-detalhe { color: rgba(255,255,255,0.8); }

/* Insights */
.insights-lista { display: flex; flex-direction: column; gap: 8px; }
.insight-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border-left: 4px solid;
    background: white;
}
.insight-card.insight-positivo {
    border-left-color: var(--verde);
    background: linear-gradient(90deg, rgba(40,167,69,0.08), white);
}
.insight-card.insight-alerta {
    border-left-color: #FF9800;
    background: linear-gradient(90deg, rgba(255,152,0,0.08), white);
}
.insight-card.insight-info {
    border-left-color: var(--azul);
    background: linear-gradient(90deg, rgba(30,136,229,0.08), white);
}
.insight-icone {
    font-size: 24px;
    width: 44px; height: 44px;
    background: white;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.insight-titulo {
    font-weight: 700;
    color: var(--azul-marinho);
    font-size: 13px;
}
.insight-desc {
    font-size: 12px;
    color: var(--texto-suave);
    margin-top: 2px;
}

/* Donut + legenda */
.legenda-cat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 12px;
}
.legenda-bolinha {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legenda-nome { flex: 1; color: var(--texto); }
.legenda-valor { font-weight: 700; color: var(--azul-marinho); }

/* Tabela relatório */
.tabela-relatorio {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.tabela-relatorio th {
    background: var(--bg);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: var(--texto-suave);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--borda);
}
.tabela-relatorio td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.tabela-relatorio tr:last-child td { border-bottom: none; }
.tabela-relatorio tr:hover { background: rgba(30,136,229,0.03); }

/* Ranking de mercados */
.merc-linha {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--borda);
}
.merc-linha:last-child { border-bottom: none; }
.merc-rank {
    font-size: 18px;
    font-weight: 700;
    color: var(--azul);
    min-width: 36px;
    text-align: center;
}
.merc-corpo { flex: 1; min-width: 0; }
.merc-topo {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}
.merc-topo strong { color: var(--azul-marinho); }
.merc-topo span { color: var(--verde); font-weight: 700; }
.merc-barra {
    height: 5px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.merc-barra-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--verde), var(--azul));
}
.merc-corpo small {
    color: var(--texto-suave);
    font-size: 11px;
}

@media (max-width: 380px) {
    .filtros-analise { grid-template-columns: 1fr; }
    .kpis-grid { grid-template-columns: 1fr 1fr; }
    .kpi-card.kpi-principal { grid-column: span 2; }
}

/* ============================================
   v2.3 - Filtros avançados + chips
   ============================================ */

/* Grid de filtros: 2 colunas (período + mercado / categoria + marca) */
.filtros-analise {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: white;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Filtros de data customizada */
.filtros-datas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: linear-gradient(135deg, rgba(40,167,69,0.05), rgba(30,136,229,0.05));
    border: 1px solid rgba(40,167,69,0.2);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}
.filtros-datas input[type="date"] {
    padding: 8px;
    border: 1px solid var(--borda);
    border-radius: 8px;
    font-size: 13px;
    background: white;
}
.filtros-datas button {
    padding: 10px;
    font-size: 13px;
    margin-top: 4px;
}

/* Chips de filtros ativos */
.filtros-ativos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    align-items: center;
}
.chip-filtro {
    background: rgba(30,136,229,0.1);
    color: var(--azul);
    padding: 4px 4px 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.chip-filtro button {
    background: var(--azul);
    color: white;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.chip-limpar {
    background: none;
    border: 1px dashed var(--borda);
    color: var(--texto-suave);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    cursor: pointer;
}
.chip-limpar:hover {
    border-color: var(--erro);
    color: var(--erro);
}

@media (max-width: 380px) {
    .filtros-analise { grid-template-columns: 1fr 1fr; }
}
