/**
 * Mashup Emendas Pix - Estilos Refinados (Alinhado com Obras)
 * Tribunal de Contas do Estado do Maranhao
 */

/* ====== RESET & BASE ====== */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.qv-state-count-bar .state.selected {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8) !important;
}

.bright.qv-panel-current-selections li {
    background-color: transparent !important;
    border-right: 1px solid #d9d9d9;
    box-shadow: none;
}

/* --- BARRA DE SELEÇÃO (Filtros) --- */
.bright.qv-panel-current-selections, .bright.qv-panel-current-selections .wrap {
	background-color: transparent !important;
	font-weight: bold !important;
	border: none !important;
}
#CurrentSelections {
	height: 40px; 
	background-color: transparent !important;
}
#CurrentSelections i, #CurrentSelections span{
	color: #dfb89c !important;
}

.bright.qv-panel-current-selections .buttons.border-right {
	border: none !important;
}

.bright.qv-panel-current-selections .no-selection {
	color: #ACC6E0 !important;
}

#TNPKUM_content .sn-kpi .sn-kpi-ellips-text {
	height: auto;
	line-height: initial;
	white-space: nowrap;
	-webkit-text-overflow: ellipsis;
	text-overflow: ellipsis;
	overflow: hidden;
	font-size-adjust
}

/* ====== SKELETON LOADING ====== */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 8px;
    animation: skeletonFadeIn 0.4s ease;
}

@keyframes skeletonFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.skeleton-bar {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.6s ease infinite;
    border-radius: 6px;
}

@keyframes skeletonShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.skeleton-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.skeleton-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0ea5e9;
    opacity: 0.4;
    animation: skeletonDotPulse 1.2s ease-in-out infinite;
}

.skeleton-dots span:nth-child(2) { animation-delay: 0.2s; }
.skeleton-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes skeletonDotPulse {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.skeleton-kpi .skeleton-bar.big { width: 55%; height: 32px; border-radius: 8px; }
.skeleton-kpi .skeleton-bar.small { width: 30%; height: 8px; }

.skeleton-chart { gap: 0; justify-content: flex-end; padding: 16px 20px 12px; }
.skeleton-chart-bars { display: flex; align-items: flex-end; gap: 10px; width: 80%; height: 65%; }
.skeleton-chart-bars .skeleton-bar { flex: 1; border-radius: 4px 4px 0 0; }
.skeleton-chart-axis { width: 80%; height: 2px; background: #e2e8f0; border-radius: 1px; margin-bottom: 10px; }

.skeleton-map-shape {
    width: 55%;
    aspect-ratio: 1;
    max-height: 60%;
    border-radius: 30% 40% 35% 45%;
    background: linear-gradient(135deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 400% 400%;
    animation: skeletonShimmer 1.6s ease infinite;
    opacity: 0.7;
}

.skeleton-table { align-items: stretch; padding: 12px 16px; gap: 0; }
.skeleton-table-row { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr 1fr 0.6fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.skeleton-table-row:first-child { border-bottom: 2px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 2px; }
.skeleton-table-row .skeleton-bar { height: 12px; width: 85%; }

.skeleton-filter { flex-direction: row; gap: 6px; padding: 0 8px; }
.skeleton-filter .skeleton-bar { height: 10px; border-radius: 4px; }

.skeleton-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    margin-top: 2px;
}

/* ====== CUSTOMIZACOES QLIK ====== */
.qlik-object { font-family: 'Inter', sans-serif; }
.kpi-value { font-weight: 800; color: #1e3a8a; }

/* ====== CARDS ====== */
.card-hover {
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1), box-shadow 0.25s cubic-bezier(.4, 0, .2, 1);
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.10), 0 4px 10px -3px rgba(30, 58, 138, 0.06);
}

.kpi-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1), box-shadow 0.25s cubic-bezier(.4, 0, .2, 1);
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 50%, #1e3a8a 100%);
    border-radius: 4px 0 0 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.10), 0 4px 10px -3px rgba(30, 58, 138, 0.06);
}
.kpi-card:hover::before { opacity: 1; }

.chart-card { transition: box-shadow 0.25s cubic-bezier(.4, 0, .2, 1); }
.chart-card:hover { box-shadow: 0 8px 20px -4px rgba(30, 58, 138, 0.08), 0 2px 8px -2px rgba(30, 58, 138, 0.04); }

/* ====== SEÇOES - TÍTULOS ====== */
.section-title { position: relative; }
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    border-radius: 2px;
    margin-top: 8px;
}

/* ====== FILTROS ALINHADOS ====== */
.filtro-row {
    display: grid;
    grid-template-columns: 118px 1px 1fr; /* regula width do filtro...alterar primeiro valor*/
    align-items: center;
    column-gap: 12px;
}
.filtro-row .filtro-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 4px; }
.filtro-row .filtro-divider { height: 32px; background: rgba(255, 255, 255, 0.20); }

/* ====== FONTE DE DADOS ====== */
.fonte-dados { transition: box-shadow 0.3s ease, border-color 0.3s ease; }
.fonte-dados:hover { box-shadow: 0 4px 12px rgba(14, 165, 233, 0.10); border-color: #0ea5e9; }

/* ====== TABS & HOVER EFFECT (Mirror Obras) ====== */
.tab-button {
    position: relative;
    transition: color 0.2s ease;
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #38bdf8;
    transition: width 0.3s ease, left 0.3s ease;
}

/* Só mostra o ::after hover em abas NÃO ativas */
.tab-button:not(.border-sky-400):hover::after {
    width: 100%;
    left: 0;
}

/* ====== ANIMAÇÃO FADE-IN AO SCROLL ====== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-section { animation: fadeInUp 0.5s ease-out both; }

/* ====== SELECTION BAR ====== */
.bright.qv-panel-current-selections,
.bright.qv-panel-current-selections .wrap {
    background-color: transparent !important;
    font-weight: bold !important;
    border: none !important;
}
#CurrentSelections { height: 40px; background-color: rgba(255, 255, 255, 0.05); }
#CurrentSelections i, #CurrentSelections span { color: #e0f2fe !important; }

/* Qlik Internal Resets */
.qv-object, .qv-inner-object { 
	background-color: transparent !important;
}
.css-rnbtta{
	margin-top: 3px !important
}

/* Ajustes de fonte para KPIs */
#QV09 .qv-object-kpi .kpi-value, #QV09 .qv-object-kpi .numeric,
#QV04 .qv-object-kpi .kpi-value, #QV04 .qv-object-kpi .numeric,
#QV08 .qv-object-kpi .kpi-value, #QV08 .qv-object-kpi .numeric {
    font-size: 18px !important; 
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f0f9ff; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #0ea5e9; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #1e3a8a; }

/* Responsividade Tabela */
@media (max-width: 640px) {
    .filtro-row { grid-template-columns: 1fr; gap: 4px; }
    .filtro-row .filtro-divider { display: none; }
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

