/**
 * ShiftLegis - Premium Design System (Standardized)
 * Design System 2.0 - ShiftLegis Day
 */

/* Importação das Fontes Oficiais */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Poppins:wght@400;500;600&display=swap');

.sidebar-wrapper {
    z-index: 2000 !important; /* Above any sticky header (1030) */
}

/* Logo dynamic switching (Sidebar toggled) */
.logo-full {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 75px;
    object-fit: contain;
    display: inline-block;
}

.logo-mini {
    display: none !important;
}

/* Quando o menu está RECOLHIDO e NÃO está com mouse por cima (hovered) */
.wrapper.toggled:not(.sidebar-hovered) .logo-full {
    display: none !important;
}

.wrapper.toggled:not(.sidebar-hovered) .logo-mini {
    display: inline-block !important;
    width: 35px; /* Tamanho ajustado para o triângulo no menu compacto */
    height: auto;
    margin: 5px auto;
}

.wrapper.toggled:not(.sidebar-hovered) .module-switcher-wrapper {
    display: none !important;
}

/* Menu Icons Colors (Vibrant Palette) */
.menu-icon-dashboard { color: #3498db !important; text-shadow: 0 2px 4px rgba(52, 152, 219, 0.15); }
.menu-icon-cadastros { color: #f39c12 !important; text-shadow: 0 2px 4px rgba(243, 156, 18, 0.15); }
.menu-icon-relatorios { color: #686de0 !important; text-shadow: 0 2px 4px rgba(104, 109, 224, 0.15); }
.menu-icon-comunicacao { color: #27ae60 !important; text-shadow: 0 2px 4px rgba(39, 174, 96, 0.15); }
.menu-icon-parceiros { color: #1abc9c !important; text-shadow: 0 2px 4px rgba(26, 188, 156, 0.15); }
.menu-icon-marketing { color: #eb4d4b !important; text-shadow: 0 2px 4px rgba(235, 77, 75, 0.15); }
.menu-icon-configuracoes { color: #f9ca24 !important; text-shadow: 0 2px 4px rgba(249, 202, 36, 0.15); }

:root {
    /* =========================
       BRAND PALETTE (OFFICIAL)
       ========================= */
    --brand-primary: #0D3F4E;       /* Azul petróleo profundo */
    --brand-secondary: #4F6D7A;     /* Azul acinzentado */
    --brand-success: #198754;       /* NOVO: Verde intenso para confirmação */
    --brand-success-hover: #157347; /* Hover do verde intenso */
    --brand-danger: #dc3545;        /* NOVO: Vermelho intenso para cancelar/limpar */
    --brand-danger-hover: #bb2d3b;  /* Hover do vermelho intenso */
    --brand-support: #B7C2B6;       /* Verde mineral */
    --brand-accent: #FBEDB9;        /* Amarelo creme */
    --brand-bg: #F8FAFB;            /* Fundo ultra limpo */
    --brand-bg-soft: #F1F4F6;       /* Soft background */

    /* =========================
       BOOTSTRAP OVERRIDES
       ========================= */
    --bs-primary: var(--brand-primary);
    --bs-secondary: var(--brand-secondary);
    --bs-body-bg: var(--brand-bg);
    --bs-body-color: #334155;
    
    /* Typography */
    --bs-font-sans-serif: 'Outfit', 'Poppins', sans-serif;
    --font-heading: 'Outfit', 'Montserrat', sans-serif;

    /* =========================
       LAYOUT & UI - PREMIUM REFINEMENTS
       ========================= */
    --radius-premium: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* Multi-layered Soft Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-ui: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-premium: 0 10px 15px -3px rgba(13, 63, 78, 0.08), 0 4px 6px -2px rgba(13, 63, 78, 0.04);
    --shadow-hover: 0 20px 25px -5px rgba(13, 63, 78, 0.1), 0 10px 10px -5px rgba(13, 63, 78, 0.04);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(12px);

    --border-color: #E2E8F0;
    --brand-gradient: linear-gradient(135deg, #0D3F4E 0%, #2A5A68 50%, #4F6D7A 100%);

    /* Button Action Variables */
    --btn-action-view: #64748b;
    --btn-action-edit: #64748b;
    --btn-action-add: #64748b;
    --btn-action-border: #e2e8f0;

    /* Grays */
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

/* ================================
   GLOBAL RESET & BASE
   ================================ */

html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

body {
    font-family: var(--bs-font-sans-serif) !important;
    background-color: var(--brand-bg-soft) !important;
    color: var(--bs-body-color) !important;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.dashboard-title,
.modal-title,
.card-title {
    font-family: var(--font-heading) !important;
    color: var(--bs-primary) !important;
    letter-spacing: -0.02em;
    font-weight: 700;
}

/* ================================
   CARDS & CONTAINERS
   ================================ */

.card, .card-premium {
    background-color: #ffffff;
    border-radius: var(--radius-premium);
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-color) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover, .card-premium:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover) !important;
    border-color: rgba(13, 63, 78, 0.2) !important;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 1.25rem 1.75rem;
    backdrop-filter: var(--glass-blur);
}

.card-header.accent {
    background: rgba(13, 63, 78, 0.03);
    border-bottom: 2px solid var(--brand-primary);
}

.card-title {
    margin-bottom: 0;
    font-size: 1.1rem;
    color: var(--brand-primary);
}

/* ================================
   BUTTONS & ACTIONS
   ================================ */

.btn-primary, .btn-premium {
    background-color: var(--brand-primary) !important; /* Petrol Green */
    border-color: var(--brand-primary) !important;
    color: #ffffff !important;
    font-family: var(--font-heading) !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 6px rgba(13, 63, 78, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover, .btn-premium:hover,
.btn-primary:focus, .btn-premium:focus,
.btn-primary:active, .btn-premium:active,
.btn-primary.active, .btn-premium.active {
    background-color: #1e605d !important; /* Vibrante Forest Green from Palette */
    border-color: #1e605d !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(13, 63, 78, 0.2);
}

/* Specific fix for white-on-white text in select/focus */
.btn-primary:not(:disabled):not(.disabled).active, 
.btn-primary:not(:disabled):not(.disabled):active, 
.show > .btn-primary.dropdown-toggle {
    background-color: var(--brand-secondary) !important;
    color: #ffffff !important;
    border-color: var(--brand-secondary) !important;
}

/* Fix for Outline Buttons */
.btn-outline-primary {
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    background-color: transparent !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active, .btn-outline-primary.active {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 4px 10px rgba(13, 63, 78, 0.15);
}

/* Fix for Light Buttons (used in Sync/Refresh) */
.btn-light {
    background-color: #f1f5f9 !important;
    color: var(--brand-primary) !important;
    border: 1px solid #e2e8f0 !important;
}

.btn-light:hover, .btn-light:focus, .btn-light:active {
    background-color: #e2e8f0 !important;
    color: var(--brand-secondary) !important;
    border-color: #cbd5e1 !important;
}

/* Botão de Sucesso/Confirmação Padronizado (Verde Intenso) */
.btn-success, 
.btn-primary, 
#btnCadastrar, 
#btnCadastrarAtendimento, 
#btnSalvarNovaSenha,
.btn-confirm {
    background-color: var(--brand-success) !important;
    border-color: var(--brand-success) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
    transition: all 0.2s ease !important;
}

.btn-success:hover, 
.btn-primary:hover, 
#btnCadastrar:hover, 
#btnCadastrarAtendimento:hover,
#btnSalvarNovaSenha:hover,
.btn-confirm:hover {
    background-color: var(--brand-success-hover) !important;
    border-color: var(--brand-success-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.2) !important;
}

/* Botão de Cancelar / Limpar / Perigo (Vermelho Intenso) */
.btn-danger,
.btn-cancel,
.btn-clear,
[id*="Limpar"],
[id*="Cancelar"],
.btn-soft-danger {
    background-color: var(--brand-danger) !important;
    border-color: var(--brand-danger) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
    transition: all 0.2s ease !important;
}

.btn-danger:hover,
.btn-cancel:hover,
.btn-clear:hover,
[id*="Limpar"]:hover,
[id*="Cancelar"]:hover,
.btn-soft-danger:hover {
    background-color: var(--brand-danger-hover) !important;
    border-color: var(--brand-danger-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2) !important;
}

.btn-soft-secondary {
    background-color: var(--btn-secondary-bg) !important;
    color: var(--btn-secondary-text) !important;
    border: 1px solid var(--btn-action-border) !important;
    font-weight: 600;
}

.btn-soft-secondary:hover {
    background-color: var(--btn-secondary-hover) !important;
    color: #1e293b !important;
}

/* Botões de Ação Sutis (Tabela/Cards) */
.btn-action-view, .btn-action-edit, .btn-action-add {
    background-color: transparent !important;
    border: 1px solid var(--btn-action-border) !important;
    transition: all 0.2s ease;
    color: var(--gray-500) !important;
}

.btn-action-view:hover, .btn-action-edit:hover, .btn-action-add:hover {
    background-color: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 63, 78, 0.2);
}

.btn-outline-primary {
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    font-weight: 600;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary.active,
.tipo-option.active {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important; /* TEXTO BRANCO OBRIGATÓRIO NO ESTADO ATIVO */
    border-color: var(--brand-primary) !important;
}

/* ================================
   FORMS & INPUTS
   ================================ */

.form-control, .form-select {
    border-color: var(--brand-support) !important;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    color: var(--brand-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(13, 63, 78, 0.1) !important;
}

.form-label {
    font-weight: 500;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

/* FIX: Placeholder e Texto de Inputs mais escuros */
::placeholder {
    color: #6c757d !important; /* Cinza escuro para placeholder */
    opacity: 1 !important;
}

:-ms-input-placeholder { /* Internet Explorer 10-11 */
    color: #6c757d !important;
}

::-ms-input-placeholder { /* Microsoft Edge */
    color: #6c757d !important;
}

/* Garante que o texto digitado seja escuro */
.form-control, .form-select, input[type="date"] {
    color: #2c3e50 !important; /* Ou var(--brand-primary) se preferir azul escuro, mas o user pediu preto */
}


/* ================================
   NAVIGATION & SIDEBAR & HEADER
   ================================ */

.sidebar-nav {
    font-family: var(--font-heading) !important;
}

.nav-link.active {
    background-color: var(--brand-accent) !important;
    color: var(--brand-primary) !important;
    font-weight: 700 !important;
    border-radius: var(--radius-sm);
}

/* FIX: Avatar Size (Prevent Explosion) */
.user-avatar {
    width: 32px !important;
    height: 32px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    max-width: 32px !important;
    max-height: 32px !important;
}

/* ================================
   MODALS
   ================================ */

.modal-content.premium-modal, .modal-content {
    border: none;
    border-radius: var(--radius-premium);
    box-shadow: var(--shadow-hover);
}

/* Fix for "Penumbra" (Backdrop overlapping interaction) */
.modal {
    z-index: 10000 !important;
}
.modal-backdrop {
    z-index: 9000 !important;
}

.modal-header {
    background-color: var(--brand-primary);
    color: white;
    border-bottom: none;
    border-top-left-radius: var(--radius-premium);
    border-top-right-radius: var(--radius-premium);
}

.modal-header .modal-title, 
.modal-header .close, 
.modal-header .btn-close {
    color: white !important;
    opacity: 1;
}

.modal-header h1, .modal-header h2, .modal-header h3, .modal-header h4, .modal-header h5 {
    color: white !important;
}

/* ================================
   TABLES
   ================================ */

.table-premium thead th {
    background-color: #fcfcfd !important;
    color: #64748b !important;
    font-family: var(--font-heading) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.table-premium tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    color: #334155;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Redimensionamento e margens das colunas de borda */
.table-premium th:first-child,
.table-premium td:first-child {
    padding-left: 2.25rem !important;
}

.table-premium th:last-child,
.table-premium td:last-child {
    padding-right: 2.25rem !important;
}

.table-premium tbody tr:hover {
    background-color: #f8fafc;
}

/* ================================
   UTILITIES & HIGHLIGHTS
   ================================ */

.text-primary {
    color: var(--brand-primary) !important;
}

.bg-primary {
    background-color: var(--brand-primary) !important;
}

.bg-accent {
    background-color: var(--brand-accent) !important;
    color: var(--brand-primary) !important;
}

.badge-premium {
    background-color: var(--brand-accent);
    color: var(--brand-primary);
    font-family: var(--font-heading) !important;
    font-weight: 700;
    padding: 0.5em 0.8em;
    border-radius: var(--radius-sm);
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--brand-secondary);
    border-radius: 4px;
}

/* ================================
   COMPATIBILITY REMOVALS & FIXES
   ================================ */

/* Remover estilo Transformers e impor novo design */
.bg-transformers {
    background: var(--brand-primary) !important;
    position: relative;
    padding: 2px 0 !important; /* Faixa fina */
    overflow: hidden;
    min-height: auto !important;
    z-index: 100; /* Lowered to prevent modal interference */
}

.dashboard-hero {
    background: transparent !important;
    padding: 0 !important; /* Zerado para eliminar qualquer espaço residual */
    margin-bottom: 0 !important;
    border-bottom: none !important;
    position: relative;
    min-height: auto !important;
}

.dashboard-hero .container-fluid {
    padding-top: 0 !important;
    padding-bottom: 4px !important;
}

.dashboard-hero::before, 
.dashboard-hero::after {
    display: none !important;
}

.dashboard-hero h1, 
.dashboard-hero h2, 
.dashboard-hero .dashboard-title {
    color: var(--brand-primary) !important;
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: -0.01em !important;
    line-height: 1.2 !important;
    margin-bottom: 0.15rem !important;
    padding: 0 !important;
}

/* Add the system tagline as a dynamic subtitle for any hero */
.dashboard-hero .container-fluid::after {
    content: "Sistema Integrado de Gestão de Gabinete";
    display: block;
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.btn-gradient {
    background: var(--brand-gradient) !important;
    color: white !important;
    border: none !important;
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

.btn-gradient:hover {
    filter: brightness(1.1);
    color: white !important;
}

/* Ajustes finos para Dashboards */
.card-body {
    padding: 1.5rem;
}

.dashboard-card-title {
    font-family: var(--font-heading) !important;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.dashboard-metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--brand-primary);
    font-family: var(--font-heading) !important;
    line-height: 1.2;
}

/* New KPI Card Style */
.kpi-card-premium {
    position: relative;
    background: white;
    border-radius: var(--radius-premium);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-card-premium:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--brand-secondary);
}

.kpi-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.kpi-card-premium:hover .kpi-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

/* Force override for the hero title font */
.dashboard-hero .dashboard-title {
    font-family: var(--font-heading) !important;
    text-transform: uppercase;
}
/* ================================
   PAGINATION OVERRIDES
   ================================ */

.page-link {
    color: var(--brand-primary) !important;
    border-color: rgba(152, 177, 182, 0.3) !important; /* Brand Secondary Opacity */
    font-family: var(--font-heading) !important;
    font-weight: 500;
}

.page-link:hover {
    color: var(--primary-hover) !important;
    background-color: var(--brand-bg-soft) !important;
    border-color: rgba(152, 177, 182, 0.5) !important;
}

.page-item.active .page-link {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

.page-item.disabled .page-link {
    color: var(--brand-secondary) !important;
    background-color: #f8fafc !important;
    border-color: rgba(152, 177, 182, 0.2) !important;
}
/* ================================
   GLOBAL TABLE LINKS
   ================================ */
/* Padroniza links em grids para usar a cor da marca em vez do azul padrão */
.table a:not(.btn):not(.text-secondary):not(.text-muted):not(.text-success):not(.text-danger) {
    color: var(--brand-primary) !important;
    text-decoration: none !important;
    font-weight: 700;
}

.table a:not(.btn):not(.text-secondary):not(.text-muted):not(.text-success):not(.text-danger):hover {
    color: var(--primary-hover) !important;
    text-decoration: underline !important;
}
/* Force override for specific legacy font classes if they exist */
.font-transformers, .transformers-font {
   font-family: var(--font-heading) !important;
}

/* ==========================================================================
   GLOBAL TABLE REFINEMENTS: BETTER SPACING FOR GRID CONTENT
   ========================================================================== */
.table th:first-child,
.table td:first-child,
.table-standard th:first-child,
.table-standard td:first-child,
.table-premium th:first-child,
.table-premium td:first-child {
    padding-left: 1.5rem !important;
}

.table th:last-child,
.table td:last-child,
.table-standard th:last-child,
.table-standard td:last-child,
.table-premium th:last-child,
.table-premium td:last-child {
    padding-right: 1.5rem !important;
}

/* ================================
   CALENDAR / AGENDA
   ================================ */

/* Base Body Spacing - Updated for no hero */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 85px !important; /* Ajustado para o novo padding menor */
}

.page-content {
    padding-top: 0 !important; /* Removido para evitar acumular com margin-top do template */
    padding-bottom: 5rem !important; /* Espaço para o footer fixo */
    background: transparent !important;
}

/* Ajuste para evitar pulos de tela ao trocar abas */
[id^="tab-"] {
    scroll-margin-top: 85px !important;
}

body {
    min-height: 100vh;
    overflow-x: hidden !important;
}

/* Specific for Dashboard since it has the hero bar */
.dashboard-body .page-content {
    padding-top: 0 !important;
}

.dashboard-hero {
    background: #f1f5f9 !important; /* Solid background to cover scrolling content */
    padding: 1rem 0 0.5rem 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important; /* Relying on .page-content margin from style.css */
    margin-bottom: 0.5rem !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    position: sticky !important; /* Make it stick below the top bar */
    top: 60px; /* Aligned with the bottom of the fixed header */
    z-index: 1020;
    min-height: auto !important;
    transition: all 0.2s ease;
}

.wrapper.toggled .dashboard-hero {
    margin-left: 70px !important;
}

@media screen and (max-width: 1024px) {
    .dashboard-hero {
        margin-left: 0 !important;
    }
}

/* Force zero gap for top-header - Standardized for ShiftLegis */
/* Force fixed footer and styling */
.footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 260px !important;
    right: 0 !important;
    z-index: 999 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color) !important;
    padding: 0.75rem 1.5rem !important;
    transition: all .2s;
}

.wrapper.toggled .footer {
    left: 70px !important;
}

@media screen and (max-width: 1024px) {
    .footer {
        left: 0 !important;
    }
}

.top-header, .top-header .navbar {
    border: none !important;
    box-shadow: none !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 15px !important; /* Space for the toggle icon area */
    min-height: auto !important;
    background: #f1f5f9 !important;
    transition: all 0.2s ease;
    /* We remove 'fixed' and 'left/right' here to let the template's native 'fixed' logic handle it */
    z-index: 1031 !important;
}

.top-header .dropdown-menu {
    z-index: 1032 !important;
}

.wrapper.toggled .top-header {
    left: 70px !important;
    margin-left: 0 !important;
}

@media screen and (max-width: 1024px) {
    .top-header {
        left: 0 !important;
        margin-left: 0 !important;
    }
}

.page-content h1.display-6 {
    margin-top: 0 !important; /* título encostado ao topo do conteúdo */
}

.dashboard-body {
    position: relative;
    z-index: 10;
    padding-top: 25px !important; /* Resetting padding as margin-top 60px from page-content + fixed header covers it */
    padding-bottom: 5rem !important;
    margin-left: 0 !important; /* Removing the double margin! style.css already gives 260px to .page-content */
    transition: all 0.2s ease;
}

.wrapper.toggled .dashboard-body {
    margin-left: 70px !important;
}

@media screen and (max-width: 1024px) {
    .dashboard-body {
        margin-left: 0 !important;
        padding-top: 40px !important;
    }
}

/* Toolbar Buttons */
.fc .fc-button-primary {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    text-transform: uppercase;
    font-weight: 600;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 6px rgba(13, 63, 78, 0.2);
}

.fc .fc-button-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.fc .fc-button-primary:disabled {
    background-color: var(--gray-400) !important;
    border-color: var(--gray-400) !important;
}

/* Headers (Days of Week) */
.fc .fc-col-header-cell-cushion {
    color: var(--brand-primary) !important;
    text-transform: uppercase;
    font-weight: 700;
    text-decoration: none !important;
    padding: 10px 0;
}

/* Day Numbers */
.fc .fc-daygrid-day-number {
    color: var(--brand-primary) !important;
    font-weight: 600;
    text-decoration: none !important;
    padding: 8px 12px;
}

/* Today Highlight */
.fc .fc-day-today {
    background-color: rgba(251, 237, 185, 0.3) !important; /* Soft Brand Yellow/Cream */
}

/* Event Items */
.fc-event {
    border: none !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 0.85rem;
    padding: 2px 4px;
}
/* ================================
   SIDEBAR MODULE SWITCHER
   ================================ */
.module-switcher-wrapper {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.module-switcher {
    display: flex;
    background-color: var(--brand-bg-soft);
    border-radius: 50px;
    padding: 4px;
    gap: 2px;
    justify-content: space-between;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
}

.module-item {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--brand-primary);
    text-decoration: none !important;
    border-radius: 50px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-family: var(--font-heading);
}

.module-item:hover {
    background-color: rgba(255,255,255,0.6);
    color: var(--brand-primary);
}

.module-item.active {
    background-color: #00A3C4; /* Cyan Highlight from Example */
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(0, 163, 196, 0.35);
}

/* ==========================================================================
   GLOBAL STANDARDIZATION: CANCEL BUTTONS ON THE LEFT
   ========================================================================== */
.d-flex .btn-outline-danger,
.d-flex .btn-outline-secondary[id*="cancelar"],
.d-flex .btn-soft-secondary[id*="cancelar"],
.d-flex .btn-secondary[data-bs-dismiss="modal"],
.d-flex #btn-cancelar,
.d-flex #btn-cancelar-novo,
.modal-footer .btn-secondary,
.modal-footer .btn-soft-secondary {
    margin-right: auto !important;
    order: -1 !important;
}

/* Ensure gap doesn't break fixed alignment */
.d-flex:has(> .me-auto) {
    gap: 0.5rem !important;
}
/* Espaçamento extra apenas para o módulo de pesquisa de munícipes (Ajustado para ser mais compacto) */
#pesquisa_municipe {
    margin-top: 1.2rem !important;
    padding: 2.2rem 2.5rem !important;
}

#pesquisa_municipe .text-center.mb-4 {
    margin-bottom: 2rem !important;
}
