/* ============================================================
   VendaFácil — Tema customizado para Filament
   Override aplicado POR CIMA do tema padrão do Filament
   (Filament já carrega Tailwind processado em app.css)
   ============================================================ */

: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;
}

/* ============================================================
   SIDEBAR — Glassmorphism
   ============================================================ */
.fi-sidebar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(226, 232, 240, 0.6) !important;
    box-shadow: 4px 0 24px -8px rgba(0, 0, 0, 0.05);
}

.fi-sidebar-item-active .fi-sidebar-item-button {
    background: linear-gradient(135deg, var(--vf-primary) 0%, var(--vf-primary-light) 100%) !important;
    color: white !important;
    border-radius: 0.625rem;
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.35);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-sidebar-item-active .fi-sidebar-item-button:hover {
    transform: translateX(2px);
    box-shadow: 0 6px 16px -2px rgba(79, 70, 229, 0.5);
}

.fi-sidebar-item-button {
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.625rem;
    margin: 2px 8px;
}

.fi-sidebar-item-button:hover {
    background: rgba(79, 70, 229, 0.08) !important;
    transform: translateX(3px);
}

/* ============================================================
   TOPBAR — Glassmorphism
   ============================================================ */
.fi-topbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ============================================================
   BOTÕES — Gradientes + Shine Effect on hover
   ============================================================ */
.fi-btn-color-primary {
    background: linear-gradient(135deg, var(--vf-primary) 0%, var(--vf-primary-light) 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    letter-spacing: 0.025em;
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.35);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fi-btn-color-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: left 600ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.fi-btn-color-primary:hover::before {
    left: 100%;
}

.fi-btn-color-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -2px rgba(79, 70, 229, 0.5);
}

.fi-btn-color-primary:active {
    transform: translateY(0) scale(0.97);
}

.fi-btn-color-success {
    background: linear-gradient(135deg, var(--vf-accent) 0%, var(--vf-accent-dark) 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.35);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-btn-color-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -2px rgba(16, 185, 129, 0.5);
}

.fi-btn-color-danger {
    background: linear-gradient(135deg, var(--vf-danger) 0%, #E11D48 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 12px -2px rgba(244, 63, 94, 0.35);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-btn-color-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -2px rgba(244, 63, 94, 0.5);
}

.fi-btn {
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fi-btn:active {
    transform: scale(0.97);
}

/* ============================================================
   CARDS / SECTIONS — Elevação + Hover
   ============================================================ */
.fi-wi-stats-overview-stat,
.fi-section,
.fi-ta-ctn,
.fi-fo-section {
    background: white !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
}

.fi-wi-stats-overview-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--vf-primary), var(--vf-primary-light));
    transition: width 300ms ease;
}

.fi-wi-stats-overview-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.12);
    border-color: rgba(79, 70, 229, 0.3) !important;
}

.fi-wi-stats-overview-stat:hover::before {
    width: 6px;
}

/* ============================================================
   FORMULÁRIOS — Inputs modernos
   ============================================================ */
.fi-input,
.fi-select-input,
.fi-textarea-input {
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 0.625rem !important;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: #F8FAFC !important;
}

.fi-input:focus,
.fi-select-input:focus,
.fi-textarea-input:focus {
    border-color: var(--vf-primary) !important;
    background: white !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

/* ============================================================
   TABELAS
   ============================================================ */
.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 !important;
    letter-spacing: 0.05em;
}

.fi-ta-row {
    transition: all 150ms ease !important;
}

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

/* ============================================================
   BADGES
   ============================================================ */
.fi-badge {
    font-weight: 600 !important;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.625rem !important;
    border-radius: 0.5rem !important;
}

.fi-badge-color-primary {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(129, 140, 248, 0.15)) !important;
    color: var(--vf-primary-dark) !important;
}

/* ============================================================
   MODAIS — Animação de entrada
   ============================================================ */
.fi-modal-window {
    border-radius: 1rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    animation: vf-modal-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vf-modal-in {
    0% { opacity: 0; transform: scale(0.95) translateY(-10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
.fi-main {
    animation: vf-page-in 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes vf-page-in {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   NOTIFICAÇÕES (toast)
   ============================================================ */
.fi-no-notification {
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15) !important;
    border-left: 4px solid var(--vf-primary) !important;
    animation: vf-toast-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vf-toast-in {
    0% { opacity: 0; transform: translateX(100%); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   SCROLLBAR customizada
   ============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #F8FAFC;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #CBD5E1, #94A3B8);
    border-radius: 10px;
    border: 2px solid #F8FAFC;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--vf-primary), var(--vf-primary-light));
}

/* ============================================================
   LOGIN PAGE — Gradient + Glassmorphism card
   (Filament 3.3 usa template "simple": `.fi-simple-page` em vez de `.fi-login-page`)
   ============================================================ */

/* Gradient aplicado APENAS em html/body/fila raiz. NÃO aplicamos em
   .fi-simple-page porque o Filament/Livewire injeta wrappers internos
   com a MESMA classe .fi-simple-page (ex: snapshot Livewire), o que
   faz o gradient aparecer DENTRO do card branco e ficar horrível. */
html.fi,
html.fi body,
body.fi,
.fi-body,
body.fi-body {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #EC4899 100%) !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    background-image: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #EC4899 100%) !important;
    min-height: 100vh;
}

/* .fi-simple-page NÃO recebe gradient — apenas posicionamento e
   estrutura. O gradient vive APENAS no html/body. */
.fi-simple-page,
.fi-login-page {
    background: transparent !important;
    background-image: none !important;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

/* Pseudo-elemento com animação flutuante sobre o gradient (apenas na raiz) */
.fi-simple-page::before,
.fi-login-page::before {
    content: '';
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.14) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(236,72,153,0.20) 0%, transparent 60%);
    animation: vf-float-bg 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes vf-float-bg {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(5%, -5%) rotate(2deg); }
}

/* Override o cinza default que o Filament injeta em alguns wrappers */
.fi-simple-layout,
main {
    background: transparent !important;
}

/* Centraliza o card horizontalmente */
.fi-simple-page,
.fi-simple-layout,
.fi-simple-page-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Pseudo-elemento com animação flutuante sobre o gradient */
.fi-simple-page::before,
.fi-login-page::before {
    content: '';
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.14) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(236,72,153,0.20) 0%, transparent 60%);
    animation: vf-float-bg 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes vf-float-bg {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(5%, -5%) rotate(2deg); }
}

/* Card de login (Filament 3.3 simple template) — glassmorphism no
   wrapper externo. O form interno (<main class="fi-simple-main">) tem
   `bg-white` Tailwind, então neutralizamos isso e deixamos o gradient
   do corpo passar com leve transparência, depois aplicamos glassmorphism
   branco MAIS OPACO por cima do conteúdo para legibilidade. */
.fi-simple-main-ctn {
    background: transparent !important;
    padding: 0 !important;
    max-width: 32rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* O <main class="fi-simple-main"> é o card VISÍVEL. Recebe glassmorphism
   branco MAIS OPACO para que o texto fique legível mas o gradient
   ainda apareça sutilmente nas bordas/blur. */
.fi-simple-main-ctn .fi-simple-main,
.fi-simple-main.my-16 {
    background: #ffffff !important;
    backdrop-filter: blur(32px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(180%) !important;
    border-radius: 1.5rem !important;
    box-shadow:
        0 32px 64px -12px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
    padding: 2.5rem !important;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

/* Cabeçalho do card: logo + título */
.fi-simple-header {
    position: relative;
    z-index: 2;
    margin-bottom: 1.5rem !important;
}

/* Garante que o logo "VendaFácil" fique destacado no card glassmorphism */
.fi-logo {
    font-size: 2.25rem !important;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #EC4899 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    margin-bottom: 0.5rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.1 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

/* "Faça login" heading — cor mais sólida para legibilidade */
.fi-simple-header-heading {
    color: #1F2937 !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
}

/* Labels dos campos — cor sólida escura para contraste sobre glassmorphism */
.fi-fo-field-wrp-label span {
    color: #1F2937 !important;
    font-weight: 600 !important;
}

/* Input wrapper com glassmorphism mais opaco */
.fi-input-wrp {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(229, 231, 235, 0.8) !important;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fi-input-wrp:focus-within {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: var(--vf-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18) !important;
}

/* Checkbox "Lembrar de mim" */
.fi-fo-checkbox-input {
    accent-color: var(--vf-primary) !important;
}

/* Label do checkbox */
.fi-fo-checkbox-label,
.fi-fo-field-wrp-label-recall {
    color: #1F2937 !important;
}

/* Botão "Sign in" / "Entrar" — gradient + shine */
.fi-simple-main button[type="submit"],
.fi-login-form button[type="submit"] {
    background: linear-gradient(135deg, var(--vf-primary) 0%, var(--vf-primary-light) 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    letter-spacing: 0.025em;
    border: none !important;
    box-shadow: 0 8px 20px -2px rgba(79, 70, 229, 0.45) !important;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.fi-simple-main button[type="submit"]::before,
.fi-login-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: left 600ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.fi-simple-main button[type="submit"]:hover::before,
.fi-login-form button[type="submit"]:hover::before {
    left: 100%;
}

.fi-simple-main button[type="submit"]:hover,
.fi-login-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -2px rgba(79, 70, 229, 0.6) !important;
}

/* Sombra de texto para o logo se destacar */
.fi-logo-text {
    color: white !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   UTILITY: gradient text
   ============================================================ */
.vf-gradient-text {
    background: linear-gradient(135deg, var(--vf-primary), var(--vf-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   USER MENU DROPDOWN FIX + animação
   ============================================================ */
.fi-dropdown-panel {
    border-radius: 0.75rem !important;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.18) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    animation: vf-dropdown-in 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vf-dropdown-in {
    0% { opacity: 0; transform: translateY(-8px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   LOADING STATES — Skeleton shimmer
   ============================================================ */
.fi-loading-indicator,
.fi-ta-ctn-loading {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.05), rgba(79, 70, 229, 0.15), rgba(79, 70, 229, 0.05));
    background-size: 200% 100%;
    animation: vf-shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

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

/* ============================================================
   DASHBOARD CHARTS — ApexCharts styling
   ============================================================ */
.apexcharts-tooltip {
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
}

.apexcharts-toolbar {
    background: transparent !important;
}

/* ============================================================
   HOVER em cards de tabela
   ============================================================ */
.fi-ta-row {
    border-bottom: 1px solid rgba(241, 245, 249, 1) !important;
}

/* ============================================================
   ACCOUNT WIDGET — Hero Card
   ============================================================ */
.fi-wi-account {
    background: linear-gradient(135deg, var(--vf-primary) 0%, var(--vf-primary-light) 100%) !important;
    color: white !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 4px 20px -2px rgba(79, 70, 229, 0.4);
}

.fi-wi-account * {
    color: white !important;
}
