/* Premium Ultra-Dark Theme Override for Filament Admin Panel */

/* Global Background */
.dark body,
.dark .fi-body,
.dark {
    background-color: #0d0d0d !important;
    color: #e5e5e5;
}

/* Sidebar Styling */
.dark .fi-sidebar {
    background-color: #111111 !important;
    border-right: 1px solid #1f1f1f !important;
}

.dark .fi-sidebar-item-active>a {
    background-color: rgba(252, 163, 17, 0.1) !important;
    color: #fca311 !important;
}

/* Topbar Styling (Glassmorphism effect) */
.dark .fi-topbar {
    background-color: rgba(13, 13, 13, 0.7) !important;
    backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid #1f1f1f !important;
}

/* Cards & Sections */
.dark .fi-section,
.dark .fi-ta-content,
.dark .fi-wi-stats-overview-stat,
.dark .fi-wi-widget {
    background-color: rgba(17, 17, 17, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8) !important;
    transition: all 0.3s ease;
}

.dark .fi-wi-stats-overview-stat:hover {
    border-color: rgba(252, 163, 17, 0.3) !important;
    box-shadow: 0 0 30px rgba(252, 163, 17, 0.05) !important;
    transform: translateY(-2px);
}

.dark canvas {
    filter: drop-shadow(0 10px 10px rgba(252, 163, 17, 0.2));
}

/* Nos widgets laterais de gráfico, o glow no canvas cria um halo/sombra visual atrás do card */
.premium-side-widget-container canvas {
    filter: none !important;
}

/* Inputs & Form Fields */
.dark .fi-input-wrapper {
    border-radius: 14px !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: all 0.3s ease;
}

.dark .fi-input-wrapper:focus-within {
    border-color: #fca311 !important;
    box-shadow: 0 0 0 1px #fca311 !important;
}

.dark .fi-input,
.dark textarea.fi-input,
.dark select.fi-select-input {
    background-color: transparent !important;
}

/* Primary Buttons (Brand Yellow) */
.fi-btn-color-primary {
    border-radius: 12px !important;
    text-transform: uppercase;
    font-weight: 900 !important;
    letter-spacing: 1px;
    transition: all 0.3s ease !important;
}

.fi-btn-color-primary:hover {
    box-shadow: 0 0 20px rgba(252, 163, 17, 0.3) !important;
    transform: translateY(-2px);
}

/* Logo Premium Styling */
.fi-logo {
    font-weight: 900 !important;
    font-style: italic;
    font-size: 1.4rem !important;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #fca311);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tables Customization */
.dark .fi-ta-table {
    border-color: #1f1f1f !important;
}

.dark .fi-ta-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: background-color 0.2s;
}

.dark .fi-ta-row:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.dark .fi-ta-header-cell {
    background-color: #0d0d0d !important;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #666;
}

/* Quick Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #fca311;
}

/* Dashboard Layout Styles */
.custom-dashboard-grid {
    display: grid !important;
    gap: 1.5rem !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

@media (min-width: 1024px) {
    .custom-dashboard-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        align-items: start !important;
    }

    .custom-dashboard-grid > * {
        min-height: 0 !important;
    }

    .col-span-12-custom {
        grid-column: span 12 / span 12 !important;
    }

    .col-span-8-custom {
        grid-column: span 8 / span 8 !important;
    }

    .col-span-4-custom {
        grid-column: span 4 / span 4 !important;
    }

    .premium-hero-widget {
        height: 412px !important;
        min-height: 412px !important;
        max-height: 412px !important;
    }

    .premium-side-widget-container {
        height: 412px !important;
        max-height: 412px !important;
        align-self: stretch !important;
    }

    .premium-side-widget-container > div {
        flex: 1 1 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }
}

.col-span-8-custom > .fi-wi-widget.fi-wi-chart {
    height: 412px !important;
    min-height: 412px !important;
    max-height: 412px !important;
    overflow: hidden !important;
}

.col-span-8-custom > .fi-wi-widget.fi-wi-chart > .fi-section {
    height: 100% !important;
    min-height: 412px !important;
    max-height: 412px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.col-span-8-custom > .fi-wi-widget.fi-wi-chart > .fi-section > div {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.col-span-8-custom > .fi-wi-widget.fi-wi-chart .fi-section-content-ctn,
.col-span-8-custom > .fi-wi-widget.fi-wi-chart .fi-section-content,
.col-span-8-custom > .fi-wi-widget.fi-wi-chart .fi-section-content > div,
.col-span-8-custom > .fi-wi-widget.fi-wi-chart .fi-section-content > div > div,
.col-span-8-custom > .fi-wi-widget.fi-wi-chart .fi-wi-chart-canvas-ctn {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
}

.col-span-8-custom > .fi-wi-widget.fi-wi-chart .fi-section-content {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
}

.col-span-8-custom > .fi-wi-widget.fi-wi-chart .fi-wi-chart-canvas-ctn {
    height: 100% !important;
    max-height: none !important;
    padding: 8px 12px 12px !important;
    overflow: hidden !important;
}

.premium-side-widget-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important; /* Mínimo de ~12px de espaço entre eles */
    height: auto !important;
    align-self: start !important;
    background: transparent !important;
}

.premium-side-widget-container>div {
    flex: none !important;
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Remover fundo/sombra do wrapper externo do widget para evitar "double shadow" ou halos */
.premium-side-widget-container .fi-wi-widget {
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
}

/* O card visível real do widget lateral é o .fi-section interno */
.premium-side-widget-container .fi-section {
    background-color: #111111 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: hidden !important;
    height: 100% !important;
    min-height: 200px !important;
    max-height: 200px !important;
    display: flex !important;
    flex-direction: column !important;
}

.premium-side-widget-container .fi-section-content-ctn {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.premium-side-widget-container .fi-section-content {
    flex: 1 !important;
    min-height: 0 !important;
    padding: 0px !important; /* Conteúdo agora encosta nas bordas */
    display: flex !important;
    flex-direction: column !important;
}

.premium-side-widget-container .fi-section-content > div {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.premium-side-widget-container .fi-section-content > div > div {
    flex: 1 !important;
    min-height: 0 !important;
}


/* Reduzir o header do widget lateral ao mínimo */
.premium-side-widget-container .fi-section-header {
    padding: 0.25rem 0.5rem !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.05); /* Linha sutil separadora */
}

.premium-side-widget-container .fi-section-header-heading {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    opacity: 0.6;
}

.premium-side-widget-container .fi-wi-chart-canvas-ctn {
    flex: 1 !important;
    height: 100% !important;
    max-height: none !important;
    padding: 6px 10px 10px !important;
}

.premium-side-widget-container .fi-wi-chart-canvas-ctn canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (min-width: 1024px) {
    .custom-dashboard-grid {
        align-items: stretch !important;
    }

    .custom-dashboard-grid > .col-span-8-custom {
        display: flex !important;
        height: 412px !important;
        min-height: 412px !important;
        max-height: 412px !important;
        overflow: hidden !important;
    }

    .custom-dashboard-grid > .col-span-8-custom > div {
        flex: 1 1 auto !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .custom-dashboard-grid > .col-span-4-custom {
        height: 412px !important;
        min-height: 412px !important;
        max-height: 412px !important;
    }

    .premium-side-widget-container {
        height: 412px !important;
        min-height: 412px !important;
        max-height: 412px !important;
        align-self: stretch !important;
    }

    .premium-side-widget-container > div {
        flex: 1 1 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .premium-side-widget-container .fi-section {
        min-height: 0 !important;
        max-height: none !important;
    }

    .custom-dashboard-grid + div {
        margin-top: 48px !important;
    }
}

/* Store Setup Alert Custom Styling */
.store-setup-alert-container {
    margin-bottom: 24px !important;
}

.store-setup-alert-section {
    min-height: 300px !important;
    background: linear-gradient(135deg, rgba(17, 17, 17, 0.9), rgba(127, 29, 29, 0.2)) !important;
    border: 1px solid rgba(220, 38, 38, 0.3) !important;
    box-shadow: 0 0 40px rgba(220, 38, 38, 0.1) !important;
}

.store-setup-alert-section:hover {
    border-color: rgba(220, 38, 38, 0.5) !important;
    box-shadow: 0 0 50px rgba(220, 38, 38, 0.15) !important;
}

.store-setup-alert-container svg {
    max-height: 48px !important;
    max-width: 48px !important;
}
