/* ============================================================
   VendaFácil Landlord — Visual ousado MAS LEGÍVEL
   Stat cards com fundo claro translúcido (não gradient vibrante
   que come os labels), sidebar com glassmorphism leve, body
   dark suave no fundo mas conteúdo CLARO para legibilidade.
   ============================================================ */

:root {
    --vf-primary: #4F46E5;
    --vf-primary-light: #818CF8;
    --vf-primary-dark: #3730A3;
    --vf-accent: #10B981;
    --vf-accent-dark: #059669;
    --vf-danger: #F43F5E;
    --vf-warning: #F59E0B;
    --vf-info: #0EA5E9;
    --vf-purple: #7C3AED;
    --vf-pink: #EC4899;
}

/* ============================================================
   BODY — Dark gradient SUTIL no fundo (não esmaga o conteúdo)
   Conteúdo fica CLARO (cards brancos) em cima, garantindo contraste.
   ============================================================ */
html.fi-landlord,
html.fi-landlord body {
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4F46E5 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    background-size: cover;
}

/* ============================================================
   TOPBAR — Glassmorphism claro (mantém contraste com texto)
   ============================================================ */
.fi-landlord .fi-topbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.fi-landlord .fi-topbar-heading,
.fi-landlord .fi-brand-name {
    background: linear-gradient(135deg, #1E1B4B 0%, #4F46E5 50%, #7C3AED 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    font-weight: 900 !important;
    letter-spacing: -0.025em !important;
}

/* ============================================================
   SIDEBAR — Glassmorphism claro + texto PRETO/CINZA ESCURO
   (em vez de branco que some no gradient)
   ============================================================ */
.fi-landlord .fi-sidebar {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-right: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 4px 0 24px -8px rgba(0, 0, 0, 0.08);
}

/* Itens do menu: texto cinza escuro, hover com fundo lavanda claro */
.fi-landlord .fi-sidebar-item-button {
    color: #1F2937 !important;
    background-image: none !important;
    border-radius: 0.625rem;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-landlord .fi-sidebar-item-button .fi-sidebar-item-icon,
.fi-landlord .fi-sidebar-item-button .fi-sidebar-item-label {
    color: #1F2937 !important;
}

.fi-landlord .fi-sidebar-item-button:hover {
    background: rgba(79, 70, 229, 0.08) !important;
    background-image: none !important;
    color: #1E1B4B !important;
    transform: translateX(3px);
}

.fi-landlord .fi-sidebar-item-button:hover .fi-sidebar-item-icon,
.fi-landlord .fi-sidebar-item-button:hover .fi-sidebar-item-label {
    color: #1E1B4B !important;
}

/* Item ativo: gradient primary com texto BRANCO (alto contraste).
   Specificity MÁXIMA para vencer classes Tailwind como bg-gray-100
   e text-primary-600 aplicadas pelo Filament. */
html.fi-landlord .fi-sidebar.fi-sidebar-item-active .fi-sidebar-item-button,
.fi-landlord .fi-sidebar .fi-sidebar-item-active.fi-sidebar-item .fi-sidebar-item-button,
body.fi-landlord .fi-sidebar-item-active > .fi-sidebar-item-button {
    background-image: linear-gradient(135deg, var(--vf-primary) 0%, var(--vf-purple) 100%) !important;
    background-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px -4px rgba(79, 70, 229, 0.6);
}

/* Label e ícone do item ativo: BRANCO.
   O Filament aplica `text-primary-600` no label ativo, que define:
     color: rgba(var(--primary-600), var(--tw-text-opacity, 1));
   E `--primary-600: 79, 70, 229` é definido inline em :root (Filament).
   Estratégia: sobrescrever ambos com specificity MÁXIMA + !important. */
html.fi-landlord body .fi-sidebar-item.fi-sidebar-item-active .fi-sidebar-item-button .fi-sidebar-item-label.fi-sidebar-item-label.text-primary-600,
html.fi-landlord body .fi-sidebar-item.fi-sidebar-item-active .fi-sidebar-item-button .fi-sidebar-item-icon.fi-sidebar-item-icon.text-primary-600,
.fi-landlord .fi-sidebar-item-active .fi-sidebar-item-label,
.fi-landlord .fi-sidebar-item-active .fi-sidebar-item-icon {
    color: #ffffff !important;
    fill: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background-image: none !important;
}

/* TAMBÉM: sobrescrever CSS variables no contexto (cobre filhos) */
html.fi-landlord body .fi-sidebar-item.fi-sidebar-item-active,
html.fi-landlord body .fi-sidebar-item.fi-sidebar-item-active .fi-sidebar-item-button,
html.fi-landlord body .fi-sidebar-item.fi-sidebar-item-active *,
html.fi-landlord body .fi-sidebar-item.fi-sidebar-item-active *::before,
html.fi-landlord body .fi-sidebar-item.fi-sidebar-item-active *::after {
    --primary-600: 255 255 255 !important;
    --primary-400: 255 255 255 !important;
    --primary-500: 255 255 255 !important;
}

.fi-landlord .fi-sidebar-item-active .fi-sidebar-item-button:hover {
    transform: translateX(4px) scale(1.02);
}

/* Hover do item ativo: mantém texto branco */
.fi-landlord .fi-sidebar-item-active .fi-sidebar-item-button:hover .fi-sidebar-item-label,
.fi-landlord .fi-sidebar-item-active .fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: #ffffff !important;
}

/* ============================================================
   MAIN CONTENT — Container transparente (mostra gradient do body)
   ============================================================ */
.fi-landlord main.fi-main,
.fi-landlord .fi-main-ctn {
    background: transparent !important;
}

/* ============================================================
   HERO CARD — Glassmorphism branco OPACO (legibilidade total)
   ============================================================ */
.vf-hero {
    position: relative;
    background: #ffffff !important;
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 32px 64px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.vf-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.18) 0%, transparent 70%);
    animation: vf-hero-glow 15s ease-in-out infinite;
    pointer-events: none;
}

.vf-hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
    animation: vf-hero-glow 18s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes vf-hero-glow {
    0%, 100% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.2) translate(5%, -5%); }
}

.vf-hero-content {
    position: relative;
    z-index: 1;
}

.vf-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #1E1B4B 0%, #4F46E5 50%, #7C3AED 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.vf-hero p {
    color: #475569;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ============================================================
   STAT CARDS — Branco translúcido + hover lift
   SEM gradient de fundo (era o problema — labels sumiam)
   Usa seletor composto para MAIOR specificity que o theme.css
   ============================================================ */
.fi-landlord .vf-stat-card,
.fi-landlord .fi-wi-stats-overview-stat.vf-stat-card {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow:
        0 8px 24px -4px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

/* Borda colorida lateral (em vez de gradient no fundo) */
.vf-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--vf-primary), var(--vf-purple));
    transition: width 300ms ease;
}

.vf-stat-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 32px -8px rgba(79, 70, 229, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
}

.vf-stat-card:hover::before {
    width: 6px;
}

/* Variant para o MRR — gradient verde sutil mas texto ainda legível */
.vf-stat-card--gradient-success {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%) !important;
}

.vf-stat-card--gradient-success::before {
    background: linear-gradient(180deg, var(--vf-accent), var(--vf-accent-dark));
}

/* Força contraste de texto dentro do stat card — labels cinza escuro, valor preto */
.vf-stat-card .fi-stat-label,
.vf-stat-card .fi-wi-stats-overview-stat-label,
.vf-stat-card [data-stat-label] {
    color: #6B7280 !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.vf-stat-card .fi-stat-value,
.vf-stat-card .fi-wi-stats-overview-stat-value,
.vf-stat-card [data-stat-value] {
    color: #111827 !important;
    font-weight: 800 !important;
}

.vf-stat-card .fi-stat-description,
.vf-stat-card .fi-wi-stats-overview-stat-description,
.vf-stat-card [data-stat-description] {
    color: #6B7280 !important;
}

/* Filament stats styling — NUNCA fundo transparente (gradient do body vaza) */
.fi-wi-stats-overview-stat {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   TABELAS — Glassmorphism branco opaco
   ============================================================ */
.fi-ta-ctn {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.fi-ta-header-cell {
    background: linear-gradient(180deg, #F8FAFC, #F1F5F9) !important;
    color: #475569 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.fi-ta-row:hover {
    background: rgba(79, 70, 229, 0.04) !important;
}

/* ============================================================
   BOTÕES — Gradients fortes (sempre com texto BRANCO)
   ============================================================ */
.fi-landlord .fi-btn-color-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 18px -4px rgba(79, 70, 229, 0.5) !important;
}

/* ============================================================
   BADGES
   ============================================================ */
.fi-badge {
    font-weight: 600 !important;
    letter-spacing: 0.025em;
}

/* ============================================================
   MODAL — Glassmorphism branco opaco
   ============================================================ */
.fi-modal-window {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   SECTION/CARD do Filament — Branco opaco
   ============================================================ */
.fi-section,
.fi-card {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   SVG illustrations
   ============================================================ */
.vf-illustration {
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 240px;
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
}

.vf-illustration svg {
    width: 100%;
    height: 100%;
}

/* ============================================================
   ANIMAÇÃO de entrada dos stats (stagger)
   ============================================================ */
.fi-wi-stats-overview-stat {
    animation: vf-stats-fadein 600ms ease-out;
}

@keyframes vf-stats-fadein {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fi-wi-stats-overview-stat:nth-child(1) { animation-delay: 0ms; }
.fi-wi-stats-overview-stat:nth-child(2) { animation-delay: 80ms; }
.fi-wi-stats-overview-stat:nth-child(3) { animation-delay: 160ms; }
.fi-wi-stats-overview-stat:nth-child(4) { animation-delay: 240ms; }
.fi-wi-stats-overview-stat:nth-child(5) { animation-delay: 320ms; }
.fi-wi-stats-overview-stat:nth-child(6) { animation-delay: 400ms; }

/* ============================================================
   ACCOUNT WIDGET — Gradient primary, texto BRANCO
   ============================================================ */
.fi-landlord .fi-wi-account {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%) !important;
    color: #ffffff !important;
    border-radius: 1rem !important;
    padding: 1.25rem !important;
    box-shadow: 0 12px 32px -8px rgba(79, 70, 229, 0.5);
}
.fi-landlord .fi-wi-account .fi-text-color-gray,
.fi-landlord .fi-wi-account .fi-icon-btn-color-gray {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* ============================================================
   NAVIGATION BADGE — Gradient primary com texto BRANCO
   ============================================================ */
.fi-sidebar-item-badge {
    background: linear-gradient(135deg, var(--vf-primary), var(--vf-purple)) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* ============================================================
   FILTROS — Glassmorphism branco
   ============================================================ */
.fi-ta-filters {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}
