@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* =========================================================
   DESIGN SYSTEM — Total Control Elite 2026
   Vibe: Executive SaaS, Premium, Clean but Dynamic
   Paleta da marca Grupo Total: azul #2A367E + laranja #EC8F28 (apoio: verde-água #12A0B4, verde #3DBE93)
 ========================================================= */

:root {
    /* Brand Colors */
    --c-blue: #2A367E;
    --c-blue-deep: #151F52;
    --c-blue-mid: #34449A;
    --c-blue-soft: #EEF0FA;

    --c-orange: #EC8F28;
    --c-orange-soft: #FDF3E7;
    --c-orange-deep: #B8661A;

    --c-teal: #12A0B4;
    --c-green: #3DBE93;

    /* Semantic UI */
    --c-success: #10B981;
    --c-danger: #EF4444;
    --c-warning: #EC8F28;
    --c-info: #3B82F6;

    /* Neutrals */
    --c-white: #ffffff;
    --c-surface: #f8fafc;
    --c-bg: #e2e8f0;
    /* Fundo mais escuro para maior contraste */
    --c-border: #cbd5e1;
    /* Borda mais visível */
    --c-border-light: #f1f5f9;
    --c-text: #1e293b;
    --c-muted: #64748b;
    --c-muted-light: #94a3b8;

    /* Effects */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-premium: 0 20px 40px -10px rgba(0, 0, 0, 0.03), 0 10px 20px -10px rgba(0, 0, 0, 0.02);

    --radius: 1.25rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === BASE RESET === */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--c-bg) !important;
    font-family: 'Outfit', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    color: var(--c-text);
    overflow: hidden;
    height: 100vh;
    margin: 0;
}

/* === SCROLLBARS (Modern Slim) === */
.custom-scroll {
    overflow-y: auto !important;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =========================================================
   SIDEBAR — painel azul-marinho no estilo "diagonal da marca" (mesma
   linguagem da tela de carregamento e do fundo.png): grade discreta,
   mosaico e filete de luz no espaço livre, item ativo com barra laranja.
   Fixa e sempre expandida (ícone + rótulo visíveis o tempo todo).
 ========================================================= */
.glass-panel-sidebar {
    background: linear-gradient(170deg, #22307a 0%, #15205a 58%, #0f1847 100%) !important;
    width: 232px !important;
    height: 100vh !important;
    border-right: 0 !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06), 6px 0 24px -12px rgba(15, 24, 71, 0.45);
    padding: 1.25rem 0.75rem !important;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    z-index: 50;
    flex-shrink: 0;
}

/* grade discreta, mais visível no topo e no rodapé */
.glass-panel-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 45%, #000 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 45%, #000 100%);
}

/* filete de luz em diagonal, acima dos itens do rodapé */
.glass-panel-sidebar::after {
    content: '';
    position: absolute;
    left: -20%;
    right: -20%;
    bottom: 232px;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: rotate(-24deg);
}

.glass-panel-sidebar > *:not(.sb-deco) {
    position: relative;
    z-index: 1;
}

.sb-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.sb-mosaic {
    position: absolute;
    left: 158px;
    bottom: 250px;
    width: 0;
    height: 0;
    transform: rotate(-32deg);
}

.sb-tile {
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    animation: sbTileIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards, sbFloat 7s ease-in-out infinite;
}

.sb-tile.is-line {
    background: none !important;
    border: 1.5px solid currentColor;
}

.sb-shine {
    position: absolute;
    top: -10%;
    bottom: -10%;
    left: -140px;
    width: 90px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
    transform: skewX(-22deg);
    animation: sbShine 9s ease-in-out 1.2s infinite;
}

@keyframes sbTileIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: var(--op); transform: none; }
}

@keyframes sbFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -5px; }
}

@keyframes sbShine {
    0% { left: -140px; }
    22%, 100% { left: 280px; }
}

.glass-panel-sidebar .h-px {
    background: rgba(255, 255, 255, 0.1) !important;
}

.glass-panel-sidebar .border-t {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.42);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-dock-item {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 0.75rem;
    gap: 11px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    transition: background-color 0.2s ease, color 0.2s ease;
    background: transparent;
    border: 0;
    margin-bottom: 2px;
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

.glass-panel-sidebar .nav-dock-item.text-slate-500 {
    color: rgba(255, 255, 255, 0.72) !important;
}

.nav-dock-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

.nav-dock-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Selecionado: pílula clara translúcida + barra laranja com brilho na lateral */
.nav-dock-item.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-dock-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #EC8F28, #f5b15e);
    box-shadow: 0 0 12px rgba(236, 143, 40, 0.6);
}

.nav-dock-item.active i {
    color: #EC8F28;
}

.glass-panel-sidebar .nav-dock-item.text-red-500 {
    color: #ff9b9b !important;
}

.glass-panel-sidebar .nav-dock-item.text-red-500:hover {
    background: rgba(255, 120, 120, 0.12) !important;
    color: #ffb4b4 !important;
}

.nav-label {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-dock-item i {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

/* Logo da sidebar — ícone (versão branca) + nome do app, sempre lado a lado */
.sidebar-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0.75rem;
    margin-bottom: 1.75rem;
}

.sidebar-brand-text {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* Nome do módulo embaixo de "Total Control" (mesmo estilo do Painel de Comissões) */
.sidebar-brand-text .sidebar-brand-sub {
    display: block;
    margin-top: 2px;
    font-family: 'IBM Plex Sans', 'Inter', sans-serif;
    font-size: 10.5px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #EC8F28;
}

/* Carregamento interno: logo em traço compacta (assets/img/loader/logo-traco-mini.svg) */
.tg-mini-loader {
    display: block;
    width: 72px;
    height: 50px;
    margin: 0 auto 10px;
}

.tg-inline-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 12px;
    color: #64748b;
    font-size: 12.5px;
    font-weight: 500;
}

.tg-inline-loader .tg-mini-loader {
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .sb-tile,
    .sb-shine {
        animation: none !important;
        opacity: var(--op);
    }
}

/* =========================================================
   SHELL E HEADER
 ========================================================= */
#mainShell {
    background: #f8fafc !important;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

header.shell-header {
    height: 60px;
    /* sem borda cinza: a base é a linha degradê da marca (header.shell-header::after) */
    border-bottom: 0 !important;
    position: relative;
    /* Barra translúcida (frosted glass), igual navigation bar do iOS/macOS */
    background: rgba(248, 250, 252, 0.75) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 0 1.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 40;
}

/* Chip de status do integrador — sem caixa/borda, só o texto agrupado */
.header-status-chip {
    padding: 0 0.5rem;
}

/* =========================================================
   AÇÕES DO HEADER — cápsula única segmentada, estilo toolbar iOS
   (em vez de dois botões separados com caixa/borda cada)
 ========================================================= */
.header-action-group {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 0.85rem;
    border-radius: 9px;
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--c-text, #334155);
    cursor: pointer;
    position: relative;
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease, transform 0.1s ease;
}

.header-action-btn i {
    font-size: 0.85rem;
    color: rgba(15, 23, 42, 0.4);
    transition: color 0.25s ease;
}

.header-action-btn:hover {
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 10px -4px rgba(15, 23, 42, 0.12);
}

.header-action-btn:hover i {
    color: var(--c-orange, #EC8F28);
}

.header-action-btn:active {
    transform: scale(0.95);
}

.header-action-divider {
    width: 1px;
    height: 18px;
    background: rgba(15, 23, 42, 0.08);
}

.header-action-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    background: var(--c-orange, #EC8F28);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f8fafc;
}

/* =========================================================
   MODAIS E OFFCANVAS — fundo desfocado (frosted glass) atrás de
   qualquer modal/painel do sistema, sem precisar editar cada um
 ========================================================= */
.modal-backdrop.show,
.offcanvas-backdrop.show {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background-color: rgba(15, 23, 42, 0.35) !important;
    opacity: 1 !important;
}

.modal-content {
    border: none !important;
}

/* =========================================================
   TROCA DE ABAS FLUIDA — as abas se sobrepõem (position: absolute)
   e fazem crossfade + leve zoom, em vez do corte seco padrão do
   Bootstrap (só opacidade, sem sobreposição real).
 ========================================================= */
.tab-content {
    position: relative;
}

.tab-content>.tab-pane {
    display: block !important;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.98) translateY(6px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.tab-content>.tab-pane.active.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* =========================================================
   CARDS (Premium Layout)
 ========================================================= */
.clean-card {
    background: var(--c-white);
    /* Sem borda visível — separação por sombra suave e em camadas, tipo macOS/iOS */
    border: 1px solid rgba(15, 23, 42, 0.05) !important;
    border-radius: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 10px 28px -14px rgba(15, 23, 42, 0.1) !important;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.clean-card:not(.static):hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 36px -16px rgba(15, 23, 42, 0.16) !important;
}

/* Card KPI Accents (Subtle Line) */
.kpi-blue {
    border-left: 3px solid var(--c-blue) !important;
}

.kpi-orange {
    border-left: 3px solid var(--c-orange) !important;
}

.kpi-indigo {
    border-left: 3px solid #6366f1 !important;
}

.kpi-accent {
    border-left: 3px solid var(--c-accent, #34449A) !important;
}

/* Special Gradient Card */
.card-total-blue {
    background: linear-gradient(135deg, var(--c-blue) 0%, #0c1a2e 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white;
}

.card-total-blue::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
}

/* =========================================================
   KPIs DO DASHBOARD — visual mais quieto/"Apple": pouca cor
   decorativa, tipografia como protagonista, espaço em vez de badges.
 ========================================================= */
.kpi-apple {
    background: white;
    border-radius: 22px;
    padding: 22px 24px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 10px 28px -16px rgba(15, 23, 42, 0.1);
    transition: box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-apple:hover {
    box-shadow: 0 4px 10px -4px rgba(15, 23, 42, 0.06), 0 20px 40px -18px rgba(15, 23, 42, 0.18);
    transform: translateY(-2px);
}

.kpi-apple:active {
    transform: translateY(-1px) scale(0.995);
    transition-duration: 0.1s;
}

.kpi-apple--dark {
    background: linear-gradient(160deg, #171e2c 0%, #0a0f1a 100%);
    border-color: transparent;
}

.kpi-apple-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--c-muted);
    margin: 0 0 8px;
    letter-spacing: 0.01em;
}

.kpi-apple-icon {
    font-size: 0.85rem;
}

.kpi-apple-label--dark {
    color: rgba(255, 255, 255, 0.5);
}

.kpi-apple-value {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--c-text);
    margin: 0;
    line-height: 1.15;
}

.kpi-apple-value--dark {
    color: white;
}

.kpi-apple-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--c-muted-light);
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kpi-apple-sub--dark {
    color: rgba(255, 255, 255, 0.65);
}

/* Anel de atividade (estilo app Saúde/Watch) pro % de uso do orçamento */
.ring-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
}

.ring-svg {
    width: 100%;
    height: 100%;
}

.ring-svg circle#ringProgress {
    transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.4s ease;
}

.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.1;
}

.ring-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--c-muted-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

/* Ícone colorido em quadrado arredondado (tipo Ajustes/Saúde) dentro dos cards */
.stat-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* =========================================================
   WELCOME HERO — cabeçalho de saudação estilo iOS (bolha de
   ícone + nome em destaque + subtítulo), igual ao topo de um
   app tipo Saúde/Wallet, no lugar da linha única e discreta.
 ========================================================= */
.hero-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 0 6px;
}

.hero-greeting-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.14);
    transition: background 0.3s ease;
}

.hero-greeting-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--c-text);
    margin: 0 0 1px;
    line-height: 1.2;
}

.hero-greeting-sub {
    font-size: 12px;
    font-weight: 500;
    color: var(--c-muted-light);
    margin: 0;
}

/* =========================================================
   ANIMAÇÕES DE ENTRADA EM CASCATA — cards e linhas de lista
   aparecem um de cada vez, não tudo junto de uma vez.
 ========================================================= */
@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kpi-pop {
    animation: popIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.kpi-pop:nth-child(1) {
    animation-delay: 0.03s;
}

.kpi-pop:nth-child(2) {
    animation-delay: 0.1s;
}

.kpi-pop:nth-child(3) {
    animation-delay: 0.17s;
}

@keyframes rowPopIn {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ios-list-row {
    animation: rowPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* =========================================================
   RELATÓRIOS — lista de grupos (painel master), linha lisa com
   estado selecionado em tom suave (tipo Mail/Notas do macOS/iOS)
   em vez de cartão com borda e sombra por item.
 ========================================================= */
.report-group-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    margin-bottom: 2px;
    border: none;
    background: transparent;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.report-group-row:hover {
    background: rgba(15, 23, 42, 0.03);
}

.report-group-row.active {
    background: var(--c-blue-soft);
}

.report-group-row-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
}

.report-group-row-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-group-row.active .report-group-row-title {
    color: var(--c-blue);
}

.report-group-row-value {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.report-group-row-pct {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
}

.report-group-row-pct.is-economia {
    color: #10b981;
}

.report-group-row-pct.is-estouro {
    color: #ef4444;
}

.report-group-row-chevron {
    flex-shrink: 0;
    font-size: 10px;
    color: rgba(15, 23, 42, 0.2);
}

/* Linhas de conta no painel de detalhe — mesma receita do .ios-group-row
   (linha inteira clicável, divisória fina, ícone + chevron) */
.report-account-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease;
}

.report-account-row:hover {
    background: rgba(15, 23, 42, 0.02);
}

.report-account-row+.report-account-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18px;
    right: 0;
    border-top: 1px solid rgba(60, 60, 67, 0.08);
}

.report-account-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 54, 126, 0.08);
    color: var(--c-blue);
    font-size: 13px;
}

.report-account-row-icon.is-over {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.report-account-row-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-account-row-sub {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    margin: 1px 0 0;
}

.report-account-row-value {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    flex-shrink: 0;
}

.report-account-row-value.is-over {
    color: #ef4444;
}

.report-account-row-pct {
    font-size: 10.5px;
    font-weight: 600;
    color: #94a3b8;
    margin: 1px 0 0;
}

.report-account-row-pct.is-over {
    color: #ef4444;
}

/* =========================================================
   TABELAS (Ultra Definition)
 ========================================================= */
.premium-table {
    width: 100%;
    border-spacing: 0;
}

.premium-table thead th {
    background: transparent !important;
    color: var(--c-muted) !important;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0;
    padding: 0.75rem 1.25rem !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07) !important;
    text-transform: none;
    z-index: 20;
}

.premium-table tbody td {
    padding: 1.1rem 1.25rem !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.045) !important;
    font-size: 0.85rem;
    color: var(--c-text);
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.premium-table tbody tr:hover td {
    background: rgba(15, 23, 42, 0.02) !important;
    color: var(--c-text) !important;
}

.premium-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* =========================================================
   BOTÕES E INPUTS
 ========================================================= */
.btn-primary-total {
    background: var(--c-blue);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(42, 54, 126, 0.2);
}

.btn-primary-total:hover {
    background: var(--c-blue-mid);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(42, 54, 126, 0.25);
}

.btn-primary-total:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.btn-secondary-total {
    background: var(--c-white);
    color: var(--c-text);
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    border: 1px solid var(--c-border);
    cursor: pointer;
}

.btn-secondary-total:hover {
    background: var(--c-surface);
    border-color: var(--c-blue);
    color: var(--c-blue);
}

.btn-secondary-total:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Toque tátil em qualquer botão nativo dentro dos cards/tabelas */
.clean-card button:active,
.kpi-apple button:active {
    transform: scale(0.96);
}

/* Toque iOS genérico: opacidade + leve encolhimento no toque */
.ios-tap:active {
    opacity: 0.7;
    transform: scale(0.96);
}

/* =========================================================
   UTILITÁRIOS DE BRANDING
 ========================================================= */
.text-total-blue {
    color: var(--c-blue) !important;
}

.text-total-orange {
    color: var(--c-orange) !important;
}

.bg-total-blue {
    background-color: var(--c-blue) !important;
}

.bg-total-orange {
    background-color: var(--c-orange) !important;
}

.bg-total-blue-soft {
    background-color: var(--c-blue-soft) !important;
}

.numbers {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Modern progress bars */
.progress-bar-total {
    height: 6px;
    background: var(--c-border-light);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.progress-fill-total {
    height: 100%;
    border-radius: 99px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   ANIMAÇÕES DE ENTRADA
 ========================================================= */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-entrance {
    animation: slideUpFade 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes pulseSubtle {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.animate-pulse-subtle {
    animation: pulseSubtle 3s ease-in-out infinite;
}

/* =========================================================
   NOTIFICAÇÃO FLUTUANTE — alerta de projeção do Fluxo de Caixa
   no Dashboard. Flutua sobre o conteúdo (não empurra os cards),
   igual a uma notificação nativa: cápsula neutra + acento vermelho.
 ========================================================= */
@keyframes fcToastIn {
    from {
        opacity: 0;
        transform: translate(14px, -6px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

.fc-toast {
    position: fixed;
    top: 76px;
    right: 2rem;
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 340px;
    padding: 0.5rem 0.7rem 0.5rem 0.6rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    animation: fcToastIn 0.45s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.fc-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    font-size: 11px;
}

.fc-toast-texto {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 11.5px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-toast-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    color: #ef4444;
    transition: color 0.2s ease;
}

.fc-toast-btn:hover {
    color: #dc2626;
}

.fc-toast-btn i {
    font-size: 9px;
}

/* =========================================================
   PAINEL DE FILTROS (offcanvas)
 ========================================================= */
#modalFiltros {
    width: 420px !important;
    box-shadow: -20px 0 40px -10px rgba(15, 23, 42, 0.12) !important;
}

/* Grupo de campo: label + select, espaçamento consistente */
.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.filtro-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin: 0;
}

.filtro-label i {
    color: var(--c-blue);
    font-size: 0.8rem;
}

/* Atalhos rápidos (Ano atual / Mês atual) */
.filtro-atalho {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--c-blue);
    background: var(--c-blue-soft);
    border: 1px solid rgba(42, 54, 126, 0.1);
    border-radius: 999px;
    padding: 3px 10px;
    transition: var(--transition);
    cursor: pointer;
}

.filtro-atalho:hover {
    background: var(--c-blue);
    color: white;
    border-color: var(--c-blue);
}

/* Botão "Limpar" do rodapé */
.filtro-btn-limpar {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--c-muted-light);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    transition: var(--transition);
}

.filtro-btn-limpar:hover {
    color: var(--c-danger);
    background: #fef2f2;
    border-color: #fecaca;
}

/* Checklist de filtro (componente próprio, sem TomSelect) — superfície única que nunca
   cresce: mostra o nome quando é 1 item, "N selecionados" quando são vários. */
.filtro-checklist {
    position: relative;
}

.filtro-checklist-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 9px 12px;
    border: 1.5px solid var(--c-border-light);
    background: var(--c-surface);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.filtro-checklist.aberto .filtro-checklist-control,
.filtro-checklist-control:focus {
    border-color: var(--c-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(42, 54, 126, 0.08);
    outline: none;
}

.filtro-checklist-texto {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-blue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filtro-checklist-texto.vazio {
    color: var(--c-muted-light);
    font-weight: 500;
}

.filtro-checklist-limpar {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    background: rgba(42, 54, 126, 0.08);
    color: var(--c-blue);
    font-size: 9px;
    cursor: pointer;
    transition: var(--transition);
}

.filtro-checklist-limpar:hover {
    background: var(--c-danger);
    color: white;
}

.filtro-checklist-seta {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--c-muted-light);
    transition: transform 0.2s ease;
}

.filtro-checklist.aberto .filtro-checklist-seta {
    transform: rotate(180deg);
}

.filtro-checklist-painel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 2000;
}

.filtro-checklist-grupo-header {
    padding: 10px 10px 4px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-muted-light);
    border-top: 1px solid var(--c-border-light);
    margin-top: 4px;
}

.filtro-checklist-grupo-header:first-child {
    border-top: none;
    margin-top: 0;
}

.filtro-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    transition: var(--transition);
}

.filtro-checklist-item:hover {
    background: var(--c-blue-soft);
}

.filtro-checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.filtro-checklist.desabilitado .filtro-checklist-control {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================================================
   SHEET ESTILO iOS (Settings.app) — usado pelos modais de Filtros
   e Exportar: sobe do rodapé com "grabber", nav bar Cancelar/Ação,
   linhas agrupadas em cartões brancos sobre fundo cinza-claro
   (system grouped background).
 ========================================================= */
.ios-sheet.offcanvas-bottom {
    --bs-offcanvas-height: min(88vh, 720px);
    width: min(560px, 94vw);
    left: 0;
    right: 0;
    margin: 0 auto;
    border: none;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -12px 40px -8px rgba(15, 23, 42, 0.22);
    background: #f2f2f7;
    display: flex;
    flex-direction: column;
}

/* Variante maior — usada por sheets que carregam tabelas/listas longas
   (ex.: dossiê de auditoria de pagamentos) */
.ios-sheet-lg.offcanvas-bottom {
    --bs-offcanvas-height: min(92vh, 860px);
    width: min(760px, 94vw);
}

.ios-sheet-grabber {
    width: 36px;
    height: 5px;
    background: rgba(15, 23, 42, 0.15);
    border-radius: 999px;
    margin: 10px auto 2px;
    flex-shrink: 0;
}

.ios-sheet-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 14px;
    flex-shrink: 0;
}

.ios-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
}

.ios-sheet-navbtn {
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--c-blue);
    padding: 4px 2px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.ios-sheet-navbtn:active {
    opacity: 0.5;
}

.ios-sheet-navbtn-primary {
    font-weight: 700;
}

.ios-sheet-body {
    flex: 1;
    min-height: 0;
    display: flex;
    background: #f2f2f7;
}

.ios-sheet-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 16px 28px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

/* Grupo: título pequeno em maiúsculas + cartão branco com as linhas */
.ios-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ios-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(60, 60, 67, 0.5);
    margin: 0;
    padding: 0 4px;
}

.ios-group-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.ios-group-title-row .ios-group-title {
    padding: 0;
}

.ios-group-card {
    background: #fff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Quando o cartão inteiro é um <button> (ex.: "Alterar Senha"), some com o
   toque de destaque padrão do navegador e dá o feedback de toque do iOS */
button.ios-group-card {
    cursor: pointer;
    transition: background 0.2s ease;
}

button.ios-group-card:active {
    background: rgba(15, 23, 42, 0.03);
}

.ios-group-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px;
    min-height: 46px;
    position: relative;
}

.ios-group-row+.ios-group-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 14px;
    right: 0;
    border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.ios-group-row-label {
    flex-shrink: 0;
    width: 44px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
}

/* Dentro do sheet, o controle do checklist perde a "caixa" própria —
   vira uma linha lisa (o cartão branco já dá o contorno) */
.ios-sheet .filtro-checklist {
    flex: 1;
    min-width: 0;
}

.ios-sheet .filtro-checklist-control {
    min-height: 38px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
}

.ios-sheet .filtro-checklist.aberto .filtro-checklist-control,
.ios-sheet .filtro-checklist-control:focus {
    box-shadow: none;
}

.ios-sheet .filtro-checklist-texto {
    text-align: right;
    color: rgba(60, 60, 67, 0.6);
    font-weight: 500;
}

.ios-sheet .filtro-checklist-texto.vazio {
    color: rgba(60, 60, 67, 0.35);
}

.ios-sheet .ios-group-row-solo .filtro-checklist-texto {
    text-align: left;
    color: #0f172a;
    font-weight: 600;
}

.ios-sheet .filtro-checklist-painel {
    border-radius: 16px;
}

/* Grupo de Contas do Exportar continua TomSelect simples — achata a
   caixa própria dele pra virar linha lisa igual ao checklist */
.ios-sheet .ios-group-row-solo {
    justify-content: space-between;
}

.ios-sheet .ts-wrapper {
    flex: 1;
    min-width: 0;
}

.ios-sheet .ts-wrapper .ts-control {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: 38px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
}

.ios-sheet .ts-dropdown {
    border-radius: 16px !important;
    border: 1px solid var(--c-border) !important;
    box-shadow: var(--shadow-lg) !important;
    margin-top: 8px !important;
    overflow: hidden;
    z-index: 2000 !important;
}

.ios-sheet .ts-dropdown .option.active {
    background: var(--c-blue-soft) !important;
    color: var(--c-blue) !important;
}

.ios-row-chevron {
    flex-shrink: 0;
    font-size: 11px;
    color: rgba(60, 60, 67, 0.3);
}

/* Reset (linha vermelha destrutiva, isolada, igual "Reset All Settings") */
.ios-group-reset {
    background: #fff;
    border: none;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-danger);
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ios-group-reset:active {
    background: rgba(239, 68, 68, 0.06);
}

/* =========================================================
   MODAL DE EXPORTAÇÃO — Ano/Mês/Grupo (seleção única, TomSelect simples;
   Empresa usa o mesmo .filtro-checklist do painel de filtros)
 ========================================================= */
#formExportarGrupo .filtro-grupo {
    gap: 0.4rem;
}

#formExportarGrupo .ts-wrapper .ts-control {
    border: 1.5px solid var(--c-border-light) !important;
    background: white !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--c-text) !important;
    transition: var(--transition);
    min-height: 42px;
}

#formExportarGrupo .ts-wrapper.focus .ts-control,
#formExportarGrupo .ts-wrapper.dropdown-active .ts-control {
    border-color: var(--c-blue) !important;
    box-shadow: 0 0 0 3px rgba(42, 54, 126, 0.08) !important;
}

#formExportarGrupo .ts-dropdown {
    border-radius: 14px !important;
    border: 1px solid var(--c-border) !important;
    box-shadow: var(--shadow-lg) !important;
    margin-top: 5px !important;
    overflow: hidden;
    z-index: 2000 !important;
}

#formExportarGrupo .ts-dropdown .option.active {
    background: var(--c-blue-soft) !important;
    color: var(--c-blue) !important;
}

/* =========================================================
   LISTA ESTILO iOS (Ajustes/Saúde) — ícone colorido em quadrado,
   divisória fina entre linhas (não caixa por item), chevron à direita
 ========================================================= */
.ios-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: background-color 0.15s ease;
    cursor: default;
}

.ios-list-row:last-child {
    border-bottom: none;
}

.ios-list-row:hover {
    background: rgba(15, 23, 42, 0.02);
}

.ios-list-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

.ios-list-body {
    flex: 1;
    min-width: 0;
}

.ios-list-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.ios-list-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    flex-shrink: 0;
}

.ios-list-chevron {
    font-size: 0.7rem;
    color: rgba(15, 23, 42, 0.2);
    flex-shrink: 0;
}

/* =========================================================
   CARGA PREMIUM (SISTEMA ELITE)
 ========================================================= */

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes logo-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
        filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.3));
    }
}

.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

.animate-spin-reverse {
    animation: spin-reverse 1.5s linear infinite;
}

.animate-logo-pulse {
    animation: logo-pulse 3s ease-in-out infinite;
}

#loadingOverlay {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   SPLASH DE CARGA — estilo iOS (tela de "instalando app"):
   ícone em squircle com anel de progresso ao redor, sem
   spinner tradicional nem fundo escuro/tech.
 ========================================================= */
.ios-splash-in {
    animation: iosSplashIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes iosSplashIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ios-splash-icon-wrap {
    position: relative;
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ios-splash-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ios-splash-ring circle#loadingRing {
    transition: stroke-dashoffset 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ícone parado dentro de um "squircle" branco — igual ao app icon real
   sendo instalado no iOS: só o anel ao redor se move, o ícone fica quieto. */
.ios-splash-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.18), 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Logo Grupo Total em traço: uma linha entra pela esquerda, contorna a logo,
   sai pela direita e a logo preenche, em loop. A animação fica dentro do
   próprio SVG (assets/img/loader/logo-traco.svg), que é largo para a linha
   ter espaço de entrar e sair. */
.ios-splash-icon-wrap:has(.tg-loader) {
    width: 330px;
    height: 111px;
}

.ios-splash-icon.tg-loader {
    width: 330px;
    height: 111px;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tg-loader img {
    width: 100%;
    height: 100%;
}

/* Fundo da tela de carregamento — "diagonal da marca" (mesma linguagem do fundo.png):
   painel azul-marinho em diagonal com grade e mosaico, faixa de luz passando,
   canto verde-água, e a área clara no centro para a logo animada. */
.tg-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f8 100%);
}

.tg-bg-panel,
.tg-bg-edge {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -10vw;
    width: 44vw;
}

.tg-bg-panel {
    background: linear-gradient(160deg, #22307a 0%, #15205a 55%, #0f1847 100%);
    clip-path: polygon(0 0, 100% 0, 62% 100%, 0 100%);
}

.tg-bg-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* filete branco acompanhando o corte diagonal */
.tg-bg-edge {
    background: #fff;
    clip-path: polygon(calc(100% - 14px) 0, 100% 0, calc(62% + 1px) 100%, calc(62% - 13px) 100%);
}

.tg-bg-shine {
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -30vw;
    width: 16vw;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    transform: skewX(-22deg);
    animation: tgBgShine 4.5s ease-in-out infinite;
}

.tg-bg-corner {
    position: absolute;
    right: -6vw;
    bottom: -8vh;
    width: 34vw;
    height: 34vh;
    background: linear-gradient(135deg, #12A0B4, #0c8497);
    clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%);
    opacity: 0.9;
}

.tg-bg-mosaic {
    position: absolute;
    left: 6vw;
    top: 12vh;
    width: 0;
    height: 0;
    transform: rotate(-32deg);
}

.tg-tile {
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    animation: tgTileIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards, tgTileFloat 6s ease-in-out infinite;
}

.tg-tile.is-line {
    background: none !important;
    border: 1.5px solid currentColor;
}

@keyframes tgBgShine {
    0%, 30% { left: -30vw; }
    70%, 100% { left: 40vw; }
}

@keyframes tgTileIn {
    from { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.6); }
    to { opacity: var(--op); transform: none; }
}

@keyframes tgTileFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -7px; }
}

@media (prefers-reduced-motion: reduce) {
    .tg-bg-shine { animation: none; display: none; }
    .tg-tile { animation: none; opacity: var(--op); }
}

/* =========================================================
   CARDS DE INDICADORES — identidade da marca (etapa 3):
   filete no topo na cor da medida, canto diagonal suave (eco do
   fundo da tela de carregamento) e ícone na mesma cor.
   Cor por card: padrão azul; .kpi-accent-orange / -green / -teal / -danger.
   Vale para .kpi-apple e para os cards .tg-kpi (clean-card do setor).
 ========================================================= */
.kpi-apple,
.tg-kpi {
    --accent: #2A367E;
    --accent-soft: rgba(42, 54, 126, 0.10);
    position: relative;
    overflow: hidden;
}

.kpi-accent-orange { --accent: #EC8F28; --accent-soft: rgba(236, 143, 40, 0.12); }
.kpi-accent-green { --accent: #3DBE93; --accent-soft: rgba(61, 190, 147, 0.13); }
.kpi-accent-teal { --accent: #12A0B4; --accent-soft: rgba(18, 160, 180, 0.12); }
.kpi-accent-danger { --accent: #EF4444; --accent-soft: rgba(239, 68, 68, 0.10); }

.kpi-apple::before,
.tg-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));
}

.kpi-apple::after,
.tg-kpi::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(135deg, transparent 40%, var(--accent-soft) 40%, transparent 78%);
    clip-path: polygon(45% 0, 100% 0, 100% 100%, 85% 100%);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.kpi-apple:hover::after,
.tg-kpi:hover::after {
    opacity: 1;
}

.kpi-apple > *,
.tg-kpi > * {
    position: relative;
    z-index: 1;
}

.kpi-apple .kpi-apple-icon,
.kpi-apple .stat-icon-badge i,
.tg-kpi .tg-kpi-icon {
    color: var(--accent) !important;
}

.kpi-apple .stat-icon-badge,
.tg-kpi .tg-kpi-icon {
    background: var(--accent-soft) !important;
}

.kpi-apple-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.66rem;
}

.ring-svg circle:first-child {
    stroke: rgba(42, 54, 126, 0.08);
}

/* títulos dos blocos de gráfico/lista com barrinha laranja → verde-água */
.clean-card header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.clean-card header h4::before {
    content: '';
    flex: none;
    width: 4px;
    height: 16px;
    border-radius: 3px;
    background: linear-gradient(180deg, #EC8F28, #12A0B4);
}

.clean-card {
    box-shadow: 0 1px 2px rgba(42, 54, 126, 0.04), 0 12px 30px -16px rgba(42, 54, 126, 0.16) !important;
}

.hero-greeting-badge {
    background: linear-gradient(135deg, rgba(236, 143, 40, 0.18), rgba(18, 160, 180, 0.14));
}

/* =========================================================
   CABEÇALHO — identidade da marca (etapa 4): acento diagonal
   laranja/verde-água antes do título, linha degradê na base,
   status e avatar nas cores da marca.
 ========================================================= */
header.shell-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(42, 54, 126, 0.55), rgba(236, 143, 40, 0.55) 45%, rgba(18, 160, 180, 0.45) 70%, transparent);
}

header.shell-header > :first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

header.shell-header > :first-child::before {
    content: '';
    flex: none;
    width: 16px;
    height: 20px;
    transform: skewX(-22deg);
    border-radius: 2px;
    background: linear-gradient(90deg, #EC8F28 0 42%, transparent 42% 58%, #12A0B4 58% 100%);
}

#heartbeatDot {
    background: #3DBE93 !important;
    box-shadow: 0 0 0 3px rgba(61, 190, 147, 0.18);
}

.header-action-group {
    background: rgba(42, 54, 126, 0.05);
}

.header-action-btn {
    color: #2A367E;
}

.header-action-btn i {
    color: rgba(42, 54, 126, 0.55);
}

#userAvatarHeader {
    background: linear-gradient(135deg, #2A367E, #12A0B4) !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(236, 143, 40, 0.7);
}

/* =========================================================
   MODAIS, FOLHAS E ALERTAS — identidade da marca:
   folhas (ios-sheet) com alça e linha degradê, título com acento
   diagonal e botão principal em pílula azul; modais Bootstrap com
   filete no topo e canto diagonal azul-marinho; SweetAlert com
   filete, botões em pílula e ícones nas cores da marca; fundo
   escurecido em azul-marinho translúcido.
 ========================================================= */
/* FOLHAS DE BAIXO (ios-sheet) */
.ios-sheet.offcanvas-bottom,
.ios-sheet-body {
    background: #f3f5fa;
}

.ios-sheet.offcanvas-bottom {
    box-shadow: 0 -16px 48px -10px rgba(15, 24, 71, .35);
}

.ios-sheet-grabber {
    width: 42px;
    background: linear-gradient(90deg, #EC8F28, #12A0B4);
    opacity: .85;
}

.ios-sheet-navbar {
    position: relative;
    padding-bottom: 16px;
    margin-bottom: 8px;
}

.ios-sheet-navbar::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(42,54,126,.5), rgba(236,143,40,.5) 50%, rgba(18,160,180,.45));
}

.ios-sheet-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #151F52;
}

.ios-sheet-title::before {
    content: '';
    flex: none;
    width: 12px;
    height: 15px;
    transform: skewX(-22deg);
    border-radius: 2px;
    background: linear-gradient(90deg, #EC8F28 0 42%, transparent 42% 58%, #12A0B4 58% 100%);
}

.ios-sheet-navbtn-primary {
    background: #2A367E;
    color: #fff;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 14px;
    box-shadow: 0 6px 14px -6px rgba(42,54,126,.6);
}

.ios-sheet-navbtn-primary:hover {
    background: #34449A;
}

.ios-group-title {
    color: rgba(42,54,126,.62);
    display: flex;
    align-items: center;
    gap: 7px;
}

.ios-group-title::before {
    content: '';
    width: 3px;
    height: 10px;
    border-radius: 2px;
    background: #EC8F28;
}

.ios-group-card {
    box-shadow: 0 1px 2px rgba(42,54,126,.06), 0 6px 16px -10px rgba(42,54,126,.18);
}

/* MODAIS CENTRAIS (Bootstrap) */
.modal-content {
    position: relative;
    box-shadow: 0 30px 70px -20px rgba(15,24,71,.45) !important;
}

.modal-content::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    z-index: 3;
    background: linear-gradient(90deg, #2A367E, #EC8F28 55%, #12A0B4);
}

.modal-header {
    position: relative;
    overflow: hidden;
}

.modal-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 140px;
    pointer-events: none;
    background: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(160deg, #22307a, #0f1847);
    clip-path: polygon(52% 0, 100% 0, 100% 100%, 26% 100%);
}

.modal-header > * {
    position: relative;
    z-index: 1;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: .85;
}

.modal-header .bg-blue-50 {
    background: rgba(42,54,126,.08) !important;
}

.modal-header .text-total-blue.uppercase {
    color: #EC8F28 !important;
}

/* fundo escurecido atrás de modais e folhas: azul-marinho translúcido */
.modal-backdrop.show,
.offcanvas-backdrop.show {
    background-color: rgba(15, 24, 71, .42) !important;
}

/* ALERTAS (SweetAlert2) */
.swal2-popup {
    border-radius: 22px;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    padding-top: 1.6em;
    box-shadow: 0 30px 70px -20px rgba(15,24,71,.45);
}

.swal2-popup::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, #2A367E, #EC8F28 55%, #12A0B4);
}

.swal2-title {
    color: #151F52;
    font-weight: 700;
    font-size: 1.35em;
}

.swal2-html-container {
    color: #64748b;
    font-size: .95em;
}

.swal2-actions .swal2-styled {
    border-radius: 999px;
    padding: .6em 1.6em;
    font-weight: 600;
    box-shadow: none !important;
}

.swal2-styled.swal2-confirm {
    background: #2A367E !important;
}

.swal2-styled.swal2-cancel {
    background: #EEF0FA !important;
    color: #2A367E !important;
}

.swal2-icon.swal2-success {
    border-color: rgba(61,190,147,.35) !important;
    color: #3DBE93 !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #3DBE93 !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(61,190,147,.3) !important;
}

.swal2-icon.swal2-warning {
    border-color: #EC8F28 !important;
    color: #EC8F28 !important;
}

.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
    border-color: #12A0B4 !important;
    color: #12A0B4 !important;
}

.swal2-container.swal2-backdrop-show {
    background: rgba(15, 24, 71, .42) !important;
}

/* --- DRAWER DE PERFIL (LIGHT PREMIUM 2026) --- */
.glass-drawer {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    border-left: 1px solid #e2e8f0;
    color: #1e293b;
    width: 400px !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

.profile-header {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    padding: 3.5rem 2rem 2.5rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}

.profile-avatar-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
}

.profile-avatar-main {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-orange), #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    border: 4px solid white;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
}

.profile-badge-role {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: #151F52;
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 99px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-stat-box {
    text-align: center;
    padding: 0.85rem 0.5rem;
    background: white;
    border-radius: 12px;
    flex: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.profile-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--c-blue);
    line-height: 1;
    margin-bottom: 4px;
}

.profile-stat-label {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

/* Linhas dentro do cartão .ios-group-card (Seu Escopo, no drawer de perfil) —
   sem caixa própria, divisória fina entre elas, igual .ios-group-row */
.profile-access-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    position: relative;
}

.profile-access-item+.profile-access-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 14px;
    right: 0;
    border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.profile-access-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-orange);
    font-size: 14px;
    flex-shrink: 0;
}

.btn-profile-action {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.btn-profile-action:hover {
    background: #f8fafc;
    border-color: var(--c-blue);
    color: var(--c-blue);
    transform: translateX(4px);
}

.profile-info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.header-profile-trigger {
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-profile-trigger:hover {
    background: rgba(15, 23, 42, 0.04);
}

.header-profile-trigger:active {
    transform: scale(0.97);
}

.header-profile-trigger #userAvatarHeader {
    border-radius: 50% !important;
    transition: all 0.3s ease;
}

.header-profile-trigger:hover #userNameHeader {
    color: var(--c-orange) !important;
}

@keyframes profileFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.profile-entry-1 {
    animation: profileFadeIn 0.4s ease-out 0.1s both;
}

.profile-entry-2 {
    animation: profileFadeIn 0.4s ease-out 0.2s both;
}

.profile-entry-3 {
    animation: profileFadeIn 0.4s ease-out 0.3s both;
}

.profile-entry-4 {
    animation: profileFadeIn 0.4s ease-out 0.4s both;
}

.profile-entry-5 {
    animation: profileFadeIn 0.4s ease-out 0.5s both;
}

/* ---- Aviso "Aplicando filtros..." (DashboardUI.mostrarCarregandoFiltro) ---- */
.carregando-filtro {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(248, 250, 252, 0.6);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.18s ease;
}
.carregando-filtro.is-visivel { opacity: 1; pointer-events: auto; cursor: progress; }
.carregando-filtro-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 22px; border-radius: 16px;
    background: #fff; border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 14px 36px -14px rgba(15, 23, 42, 0.35);
    font: 600 14px/1.2 'Outfit', sans-serif; color: #2A367E;
    transform: translateY(6px); transition: transform 0.2s ease;
}
.carregando-filtro.is-visivel .carregando-filtro-card { transform: none; }
.carregando-filtro-spin {
    width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%;
    border: 3px solid rgba(42, 54, 126, 0.15); border-top-color: #EC8F28;
    animation: carregandoFiltroGira 0.8s linear infinite;
}
@keyframes carregandoFiltroGira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .carregando-filtro-spin { animation-duration: 2.4s; } }


/* =========================================================
   CELULAR E TABLET (abaixo de 1024 px) — barra lateral vira menu
   recolhível (botão no cabeçalho), cabeçalho sem transbordar e
   conteúdo com margens menores. Nada aqui vale no desktop (≥ 1024 px).
 ========================================================= */
.shell-menu-btn,
.sidebar-backdrop {
    display: none;
}

@media (max-width: 1023.98px) {
    .glass-panel-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100dvh !important;
        z-index: 1060;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
    }

    body.sidebar-aberta .glass-panel-sidebar {
        transform: none;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(8, 17, 32, 0.45);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.sidebar-aberta .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .shell-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 10px;
        background: rgba(42, 54, 126, 0.06);
        color: #2A367E;
        font-size: 1.25rem;
    }

    /* o acento diagonal do título dá lugar ao botão do menu */
    header.shell-header > :first-child::before {
        display: none;
    }

    header.shell-header {
        padding: 0 1rem;
        gap: 10px;
    }

    header.shell-header > :first-child {
        min-width: 0;
        flex: 1 1 auto;
        gap: 10px;
    }

    #content-title {
        flex-shrink: 1 !important;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* margens laterais menores nas abas */
    #content-body .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* gráfico mensal e ranking com altura própria quando empilham (a seção não espreme mais os dois) */
    #charts-tab main > section:has(#chartEvolucao) {
        flex: none;
    }

    div:has(> #chartEvolucao) {
        min-height: 280px;
    }

    #listaTopSetores {
        min-height: 280px;
    }

    /* aviso de contas em risco entra no fluxo da página (fixo, cobria a saudação) */
    .fc-toast {
        position: static;
        max-width: none;
    }

    .fc-toast-texto {
        white-space: normal;
    }
}

@media (max-width: 639.98px) {
    /* cabeçalho em duas linhas: título + ações em cima, seletor de setor embaixo */
    header.shell-header {
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 10px 12px;
        row-gap: 8px;
    }

    /* botão, título e seletor viram itens do próprio cabeçalho: o seletor ocupa a 2ª linha inteira */
    header.shell-header > :first-child {
        display: contents;
    }

    #content-title {
        font-size: 17px !important;
        line-height: 36px;
        flex: 1 1 0;
    }

    #gestorSetorChip {
        flex: 1 0 100%;
        order: 10;
    }

    #gestorSetorChip select {
        max-width: none !important;
        flex: 1 1 auto;
    }

    /* Filtros/Extrair só com ícone */
    .header-action-btn > span:not(.header-action-badge) {
        display: none;
    }

    .header-action-btn {
        padding: 0.5rem 0.65rem;
    }

    .header-profile-trigger {
        flex: none;
    }

    /* Relatórios: lista de grupos em cima e o detalhe embaixo (antes o detalhe sumia no celular) */
    #relatorios-tab > .clean-card {
        overflow-y: auto !important;
    }

    #relatorios-tab > .clean-card > .flex-1.flex {
        flex-direction: column;
        overflow: visible;
        flex: none;
    }

    #relatorios-tab aside {
        height: auto !important;
        max-height: 46vh;
        min-width: 0 !important;
        border-right: 0 !important;
        border-bottom: 1px solid #f1f5f9;
    }

    #relatorios-tab section.hidden {
        display: flex !important;
        min-height: 70vh;
        height: auto !important;
    }

    #detalheHeaderCC {
        padding: 1rem !important;
    }

    #detalheKpiCC {
        flex-wrap: wrap;
        gap: 12px 20px !important;
    }

    /* cabeçalhos de cartões de lista que quebram */
    .kpi-apple-value {
        font-size: 1.45rem;
    }
}

/* Painel do Gestor entre 1024 e 1279 px: gráfico e ranking empilhados (ModoSetor.js) precisam de altura própria */
@media (max-width: 1279.98px) {
    html.modo-gestor #charts-tab main > section:has(#chartEvolucao) {
        flex: none;
    }

    html.modo-gestor div:has(> #chartEvolucao) {
        min-height: 300px;
    }

    html.modo-gestor #listaTopSetores {
        min-height: 280px;
    }
}
