/* Tema dark — TV Remoto (contraste forçado) */
:root,
.dark,
html.fi {
    --tv-bg: #0b1220;
    --tv-surface: #111827;
    --tv-card: #1a2332;
    --tv-border: #2a3648;
    --tv-text: #e8eef7;
    --tv-muted: #a8b4c4;
    --tv-heading: #ffffff;
}

/* Fundo */
html.fi,
html.dark,
.fi-body,
.dark .fi-body {
    background-color: var(--tv-bg) !important;
    color: var(--tv-text) !important;
}

.fi-main,
.fi-main-ctn,
.dark .fi-main,
.dark .fi-main-ctn {
    background-color: var(--tv-bg) !important;
    color: var(--tv-text) !important;
}

.fi-sidebar,
.fi-sidebar-nav,
.dark .fi-sidebar,
.dark .fi-sidebar-nav {
    background-color: var(--tv-surface) !important;
    border-color: var(--tv-border) !important;
    color: var(--tv-text) !important;
}

.fi-topbar,
.dark .fi-topbar {
    background-color: rgba(17, 24, 39, 0.95) !important;
    border-bottom: 1px solid var(--tv-border);
    backdrop-filter: blur(10px);
    color: var(--tv-text) !important;
}

.fi-sidebar-header,
.dark .fi-sidebar-header {
    background-color: var(--tv-surface) !important;
    border-bottom: 1px solid var(--tv-border);
    color: var(--tv-heading) !important;
}

/* Cards / widgets */
.fi-section,
.fi-wi-stats-overview-stat,
.fi-ta-ctn,
.fi-fo-tabs,
.fi-simple-page,
.fi-account-widget,
.fi-wi-widget,
.dark .fi-section,
.dark .fi-wi-stats-overview-stat,
.dark .fi-ta-ctn,
.dark .fi-fo-tabs,
.dark .fi-simple-page,
.dark .fi-account-widget,
.dark .fi-wi-widget {
    background-color: var(--tv-card) !important;
    border-color: var(--tv-border) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
    color: var(--tv-text) !important;
}

.fi-page-header-main-ctn,
.fi-header,
.dark .fi-page-header-main-ctn,
.dark .fi-header {
    background: transparent !important;
}

/* ===== Textos e números — SEMPRE claros ===== */

/* Título da página (ex: Painel de Controle) */
.fi-header-heading,
.fi-page-header-heading,
h1.fi-header-heading,
.fi-header h1,
.fi-main h1 {
    color: var(--tv-heading) !important;
}

.fi-header-subheading,
.fi-page-header-subheading {
    color: var(--tv-muted) !important;
}

/* Widget Bem-vindo */
.fi-account-widget,
.fi-account-widget * {
    color: var(--tv-text);
}

.fi-account-widget-heading,
.fi-account-widget h2,
.fi-account-widget .text-sm,
.fi-account-widget .font-semibold,
.fi-account-widget .text-base {
    color: var(--tv-heading) !important;
}

.fi-account-widget .text-gray-950,
.fi-account-widget .text-gray-900,
.fi-account-widget .text-gray-800,
.fi-account-widget .text-gray-700 {
    color: var(--tv-heading) !important;
}

/* Stats: títulos e valores grandes */
.fi-wi-stats-overview-stat-label,
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label {
    color: var(--tv-muted) !important;
}

.fi-wi-stats-overview-stat-value,
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-value {
    color: var(--tv-heading) !important;
}

/* Qualquer text-gray escuro dentro do painel */
.fi-main .text-gray-950,
.fi-main .text-gray-900,
.fi-main .text-gray-800,
.fi-body .text-gray-950,
.fi-body .text-gray-900,
.fi-body .text-gray-800,
.fi-sidebar .text-gray-950,
.fi-topbar .text-gray-950,
.fi-simple-page .text-gray-950,
.fi-simple-page .text-gray-900 {
    color: var(--tv-heading) !important;
}

.fi-main .text-gray-700,
.fi-main .text-gray-600,
.fi-body .text-gray-700,
.fi-body .text-gray-600,
.fi-simple-page .text-gray-700,
.fi-simple-page .text-gray-600 {
    color: var(--tv-muted) !important;
}

.fi-main .text-gray-500,
.fi-body .text-gray-500 {
    color: var(--tv-muted) !important;
}

/* Tabelas */
.fi-ta-header-cell,
.fi-ta-header-cell-label,
.fi-ta-text,
.fi-ta-cell,
.fi-ta-empty-state-heading,
.fi-section-header-heading,
.fi-modal-heading,
.fi-fo-field-wrp-label,
.fi-fo-field-wrp-label span,
label.fi-fo-field-wrp-label {
    color: var(--tv-text) !important;
}

.fi-ta-empty-state-description,
.fi-section-header-description,
.fi-modal-description {
    color: var(--tv-muted) !important;
}

/* Inputs */
.fi-input,
.fi-select-input,
textarea.fi-input {
    color: var(--tv-heading) !important;
}

.fi-input::placeholder {
    color: var(--tv-muted) !important;
}

/* Sidebar */
.fi-sidebar-item-button,
.fi-sidebar-item-label,
.fi-sidebar-group-label {
    color: var(--tv-muted) !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button,
.fi-sidebar-item-active .fi-sidebar-item-label {
    color: #fff !important;
}

.fi-logo,
.fi-logo span {
    color: var(--tv-heading) !important;
}

/* Login */
.fi-simple-layout,
.dark .fi-simple-layout {
    background:
        radial-gradient(ellipse 70% 50% at 15% 0%, rgba(59, 130, 246, 0.18), transparent 55%),
        radial-gradient(ellipse 55% 40% at 90% 10%, rgba(148, 163, 184, 0.12), transparent 50%),
        var(--tv-bg) !important;
    color: var(--tv-text) !important;
}

.fi-simple-main,
.dark .fi-simple-main {
    background-color: transparent !important;
}

.fi-simple-card,
.dark .fi-simple-card {
    background-color: var(--tv-card) !important;
    border: 1px solid var(--tv-border) !important;
    color: var(--tv-text) !important;
}

.fi-simple-card h1,
.fi-simple-card h2,
.fi-simple-header-heading {
    color: var(--tv-heading) !important;
}

/* Preview de vídeo como miniatura */
.tv-video-upload .filepond--root,
.fi-fo-file-upload .filepond--root {
    max-width: 280px;
}

.tv-video-upload .filepond--item,
.fi-fo-file-upload .filepond--item[data-filepond-item-state] {
    width: 240px !important;
}

.tv-video-upload .filepond--media-preview-wrapper,
.tv-video-upload .filepond--image-preview-wrapper,
.fi-fo-file-upload .filepond--media-preview-wrapper,
.fi-fo-file-upload .filepond--image-preview-wrapper {
    height: 120px !important;
    max-height: 120px !important;
}

.tv-video-upload video,
.fi-fo-file-upload video,
.fi-fo-file-upload .filepond--media-preview video {
    width: 100% !important;
    max-width: 240px !important;
    height: 120px !important;
    max-height: 120px !important;
    object-fit: cover !important;
    border-radius: 0.5rem;
    background: #0b1220;
}

.tv-video-upload .filepond--panel-root,
.fi-fo-file-upload .filepond--panel-root {
    background-color: var(--tv-surface) !important;
}

/* Miniatura na tabela de vídeos */
.tv-video-thumb,
.tv-video-thumb video {
    width: 96px !important;
    height: 56px !important;
    max-width: 96px !important;
    max-height: 56px !important;
    object-fit: cover !important;
}

.fi-ta-cell .tv-video-thumb video,
.fi-ta-text .tv-video-thumb video,
td video.tv-table-video {
    width: 96px !important;
    height: 56px !important;
}
