    :root {
        --bg-main: #edf2f9;
        --bg-card: #ffffff;
        --bg-card-alt: whitesmoke;
        --text-color: rgba(0, 0, 0, 0.76);
        --text-color-strong: rgba(0, 0, 0, 0.801);
        --border-accent: black;
        --border-light: rgba(0, 0, 0, 0.089);
        --border-medium: rgba(0, 0, 0, 0.137);
        --shadow-color: rgba(0, 0, 0, 0.103);
        --shadow-color-strong: rgba(0, 0, 0, 0.123);
        --active-bg: #00000015;
        --grey-muted: grey;
        --user-avatar-bg: rgb(209, 207, 207);
        --bar-strong: rgba(0, 0, 0, 0.75);
        --bar-medium: rgba(0, 0, 0, 0.5);
        --bar-light: rgba(0, 0, 0, 0.28);
        --welcome-overlay: rgba(20, 20, 20, 0.85);
        --sidebar-width: 250px;
        --sidebar-width-collapsed: 84px;
        --sidebar-bg: #275ed1;;

        /* Cores por área de formação */
        --color-exatas: #3661C9;
        --color-sociais: #B23A82;
        --color-saude: #2E9E5C;

        /*Cores para Gráfico de Gênero*/
        --genero-masc: #3661C9;   /* azul */
        --genero-fem: #B23A82;    /* rosa */

        /*Cores para Gráfico de Regime*/
        --regime-diurno: #1a5276;      /* azul escuro - claro */
        --regime-noturno: #7f8c8d;
    }
                
    body.dark-mode {
        --bg-main: #121212;
        --bg-card: #1E1E1E;
        --bg-card-alt: #262626;
        --text-color: #EAEAEA;
        --text-color-strong: #EAEAEA;
        --border-accent: #ffffff;
        --border-light: rgba(255, 255, 255, 0.089);
        --border-medium: rgba(255, 255, 255, 0.137);
        --shadow-color: rgba(0, 0, 0, 0.4);
        --shadow-color-strong: rgba(0, 0, 0, 0.5);
        --active-bg: #ffffff15;
        --grey-muted: #a0a0a0;
        --user-avatar-bg: #3a3a3a;
        --bar-strong: rgba(255, 255, 255, 0.85);
        --bar-medium: rgba(255, 255, 255, 0.55);
        --bar-light: rgba(255, 255, 255, 0.3);
        --welcome-overlay: rgba(10, 10, 10, 0.92);
        --sidebar-bg: #1E1E1E;

        --color-exatas: #6C93E8;
        --color-sociais: #E06BB0;
        --color-saude: #48C97A;

        /*Cores para Gráfico de Gênero*/
        --genero-masc: #5dade2;   /* azul */
        --genero-fem: #B23A82;    /* rosa */

        /*Cores para Gráfico de Regime*/
        --regime-diurno: #5dade2;      /* azul claro - escuro */
        --regime-noturno: #bdc3c7;
    }

    * {
        margin: 0;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
    }

    body {
        height: 100vh;
        background-color: var(--bg-main);
        display: flex;
        overflow: hidden;
        position: fixed;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    /* ================= SIDE NAV ================= */

    .sideNavBar {
        width: var(--sidebar-width);
        height: 100%;
        background-color: var(--sidebar-bg);
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 20px 16px;
        overflow-y: auto;
        overflow-x: hidden;
        flex-shrink: 0;
        transition: background-color 0.3s ease, width 0.25s ease, padding 0.25s ease;
    }

    #navBarIntro {
        display: flex;
        width: 100%;
        gap: 10px;
        justify-content: center;
        align-items: center;
        margin-bottom: 14px;
        flex-shrink: 0;
    }

    #logo-uan {
        height: 78px;
        width: 78px;
        flex-shrink: 0;
        transition: height 0.25s ease, width 0.25s ease;
    }

    .navSectionLabel {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.8px;
        text-transform: uppercase;
        color: var(--grey-muted);
        padding: 14px 10px 6px;
        width: auto;
    }

    .sideMenuItem .viewAlllink {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        color: inherit;
        text-decoration: none;
    }

    .sideMenuItemHeader {
        display: flex;
        align-items: center;
        padding: 12px 10px;
        border-radius: 10px;
        cursor: pointer;
        gap: 10px;
        border-left: 2px solid transparent;
        transition: background-color 0.18s ease, border-color 0.18s ease;
    }

    .sideMenuItemHeader:hover {
        background-color: var(--bg-card-alt);
    }

    .sideMenuItem:not(.hasSubMenu) {
        padding: 12px 10px;
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        border-left: 2px solid transparent;
        border-radius: 10px;
        transition: background-color 0.18s ease, border-color 0.18s ease;
    }

    .sideMenuItem:not(.hasSubMenu):not(.activesideMenuItem):hover {
        background-color: var(--bg-card-alt);
    }

    .activesideMenuItem,
    .activesideMenuItem .sideMenuItemHeader {
        background-color: var(--active-bg);
        border-left: 2px solid var(--border-accent);
    }

    .itemName {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 14px;
        color: var(--text-color);
        display: flex;
        font-weight: 600;
        gap: 5px;
        flex: 1;
        width: auto;
        white-space: nowrap;
    }

    .chevron {
        margin-left: auto;
        transition: transform 0.25s ease, color 0.18s ease;
        color: var(--grey-muted);
        width: fit-content;
        font-size: 19px;
    }

    .sideMenuItem.open .chevron {
        transform: rotate(180deg);
        color: var(--text-color-strong);
    }

    .subMenu {
        list-style: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding-left: 38px;
    }

    .sideMenuItem.open .subMenu {
        max-height: 200px;
    }

    .subMenuItem {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12.5px;
        color: var(--text-color);
        padding: 9px 10px;
        margin: 2px 0;
        border-radius: 8px;
        cursor: pointer;
        width: calc(100% - 10px);
        border-left: 2px solid transparent;
        transition: background-color 0.18s ease, border-color 0.18s ease;
    }

    .subMenuItem:hover {
        background-color: var(--bg-card-alt);
    }

    .subMenuItem.activeSubMenuItem {
        background-color: var(--active-bg);
        border-left: 2px solid var(--border-accent);
        font-weight: 600;
    }

    i {
        width: fit-content;
        color: var(--text-color-strong);
    }

    .sideNavFooter {
        margin-top: auto;
        padding-top: 10px;
        border-top: 1px solid var(--border-light);
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex-shrink: 0;
    }

    .navVersion {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        color: var(--grey-muted);
        text-align: center;
        padding: 8px 0 2px;
        width: 100%;
        white-space: nowrap;
    }

    /* ---- Botão de colapsar a barra lateral ---- */

    .sidebarCollapseBtn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 10px;
        margin-top: 4px;
        border: none;
        border-radius: 10px;
        background-color: transparent;
        color: var(--grey-muted);
        cursor: pointer;
        transition: background-color 0.18s ease, color 0.18s ease;
    }

    .sidebarCollapseBtn:hover {
        background-color: var(--bg-card-alt);
        color: var(--text-color-strong);
    }

    .sidebarCollapseBtn i {
        color: inherit;
        transition: transform 0.25s ease;
    }

    /* Estado colapsado: apenas ícones, sem textos nem submenus expansíveis */
    .sideNavBar.collapsed {
        width: var(--sidebar-width-collapsed);
        padding: 20px 12px;
        align-items: center;
    }

    .sideNavBar.collapsed #logo-uan {
        height: 40px;
        width: 40px;
    }

    .sideNavBar.collapsed .itemName,
    .sideNavBar.collapsed .chevron,
    .sideNavBar.collapsed .navSectionLabel,
    .sideNavBar.collapsed .navVersion,
    .sideNavBar.collapsed .subMenu {
        display: none;
    }

    .sideNavBar.collapsed .sideMenuItem,
    .sideNavBar.collapsed .sideMenuItemHeader {
        width: fit-content;
        justify-content: center;
    }

    .sideNavBar.collapsed .sideNavFooter {
        align-items: center;
    }

    .sideNavBar.collapsed .sidebarCollapseBtn i {
        transform: rotate(180deg);
    }

    .sideNavBar.collapsed .sideMenuItem.hasSubMenu {
        position: relative;
    }

    .sideNavBar.collapsed .sideMenuItem.hasSubMenu .subMenu {
        display: block;
        position: absolute;
        left: 100%;
        top: 0;
        margin-left: 10px;
        width: 180px;
        max-height: none;
        height: 0;
        padding: 0;
        background-color: var(--bg-card);
        border-radius: 10px;
        box-shadow: 2px 2px 6px var(--shadow-color-strong);
        z-index: 20;
        overflow: hidden;
    }

    .sideNavBar.collapsed .sideMenuItem.hasSubMenu.open .subMenu {
        height: auto;
        padding: 10px;
    }

    .sideNavBar.collapsed .subMenuItem {
        width: 100%;
    }

    /* ================= MAIN CONTENT ================= */

    .mainContent {
        flex: 1;
        padding: 20px;
        display: flex;
        gap: 15px;
        flex-direction: column;
        align-items: left;
        overflow-y: auto;
        min-width: 0;
    }

    #topNavBar {
        height: 64px;
        flex-shrink: 0;
        display: flex;
        align-items: end;
        justify-content: end;
        gap: 24px;
    }

    .searchSec {
        height: 44px;
        width: 300px;
        flex-shrink: 0;
        background-color: var(--bg-card);
        border-radius: 12px;
        padding: 0px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        box-shadow: 0 1px 2px var(--shadow-color);
        transition: background-color 0.3s ease, box-shadow 0.3s ease;
    }

    .searchSec .search-icon {
        font-size: 20px;
        color: var(--grey-muted);
        flex-shrink: 0;
        width: fit-content;
    }

    #search {
        height: 100%;
        flex: 1;
        border: none;
        background: transparent;
        color: var(--text-color-strong);
        font-family: Arial, Helvetica, sans-serif;
        font-size: 14px;
        font-weight: 500;
    }

    #search::placeholder {
        color: var(--grey-muted);
        font-weight: 500;
    }

    .iconModel.searchToggleBtn {
        display: none;
    }

    .flutuantModel {
        box-shadow: 2px 2px 1px var(--shadow-color);
        border-radius: 10px;
        background-color: var(--bg-card);
        transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    }

    h2 {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 16px;
        font-weight: 500;
        flex: none;
        width: fit-content;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text-color-strong);
    }

    h2 strong {
        font-weight: 700;
    }

    .userInfoSection {
        display: flex;
        gap: 10px;
        width: fit-content;
        flex-shrink: 0;
        align-items: center;
    }

    .periodDropdown {
        position: relative;
        width: fit-content;
        flex-shrink: 0;
    }

    .periodDropdownBtn {
        height: 36px;
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 0 12px;
        background-color: var(--bg-card-alt);
        border: 1px solid var(--border-light);
        border-radius: 10px;
        cursor: pointer;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--text-color-strong);
        width: fit-content;
        transition: background-color 0.18s ease, border-color 0.18s ease;
    }

    .periodDropdownBtn:hover {
        background-color: var(--active-bg);
    }

    .periodDropdownBtn i {
        font-size: 18px;
        color: var(--grey-muted);
        width: fit-content;
        transition: transform 0.2s ease;
    }

    .periodDropdown.open .periodDropdownBtn i {
        transform: rotate(180deg);
    }

    .periodDropdownMenu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        min-width: 130px;
        background-color: var(--bg-card);
        border-radius: 10px;
        box-shadow: 0 10px 24px var(--shadow-color-strong);
        border: 1px solid var(--border-light);
        padding: 6px;
        display: none;
        flex-direction: column;
        gap: 2px;
        z-index: 40;
    }

    .periodDropdown.open .periodDropdownMenu {
        display: flex;
    }

    .periodDropdownItem {
        padding: 9px 10px;
        border-radius: 8px;
        cursor: pointer;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--text-color);
        width: auto;
        transition: background-color 0.15s ease;
    }

    .periodDropdownItem:hover {
        background-color: var(--bg-card-alt);
    }

    .periodDropdownItem.activePeriodItem {
        background-color: var(--active-bg);
        color: var(--text-color-strong);
    }

    .iconModel {
        min-width: 50px;
        height: 100%;
        background-color: var(--bg-card);
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .userInfoModel {
        display: flex;
        justify-content: center;
        align-items: center;
        padding-left: 5px;
        gap: 10px;
        min-width: 200px;
        max-width: 300px;
    }

    .userInfoModel p {
        font-family: Arial, Helvetica, sans-serif;
        color: var(--text-color);
    }

    .userImage {
        height: 85%;
        width: 60px;
        background-color: var(--user-avatar-bg);
        border-radius: 100%;
        background-position: center;
        transition: background-color 0.3s ease;
    }

    #userName {
        text-overflow: ellipsis;
        color: var(--text-color-strong);
    }

    #userEmail {
        font-size: 10px;
        color: var(--grey-muted);
        font-weight: bold;
    }

    /* ================= SECTION 2 LAYOUT ================= */

    .section2 {
        width: 100%;
        flex: 1;
        display: flex;
        gap: 20px;
    }

    .section2-leftside {
        height: 100%;
        width: 10px;
        display: flex;
        gap: 10px;
        flex-direction: column;
        flex: 2.5;
    }

    .section2-rightside {
        height: 100%;
        width: 10px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        flex: 1;
    }

    .leftCardElement {
        width: 100%;
        flex: 1;
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 15px;
        overflow: hidden;
    }

    .rightCardElement1 {
        width: 100%;
        flex: 2.5;
        background-color: var(--bg-card-alt);
        display: flex;
        border-radius: 30px;
        border-right: 1px solid var(--border-light);
        box-shadow: 1px 1px 1px var(--shadow-color-strong);
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .card1,
    .card2 {
        height: 100%;
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .card1 {
        background-color: var(--bg-card);
        border-radius: 30px;
        border-right: 3px solid var(--border-medium);
        flex: 3;
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .card2 {
        background-color: var(--bg-card-alt);
        border-radius: 0px 30px 30px 0px;
        flex: 1;
        justify-content: center;
        transition: background-color 0.3s ease;
    }

    .chart-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        flex-wrap: wrap;
    }

    .chart-headline {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: fit-content;
        flex: 1 1 auto;
        min-width: 0;
    }

    .chartTitleGroup {
        width: fit-content;
    }

    .chartTitleGroup p.chartLabel {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 13px;
        color: var(--grey-muted);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .chartTitleGroup h3 {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 30px;
        color: var(--text-color-strong);
        font-weight: 700;
        width: fit-content;
    }

    .chart-subtitle {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        color: var(--grey-muted);
        font-weight: 500;
        width: fit-content;
    }

    .chart-legend-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 18px;
        width: 100%;
        overflow-x: auto;
        padding: 6px 2px 10px;
        border-bottom: 1px solid var(--border-light);
        scrollbar-width: thin;
    }

    .legend-item {
        display: flex;
        align-items: center;
        gap: 7px;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-color);
        cursor: pointer;
        user-select: none;
        padding: 3px 6px;
        border-radius: 8px;
        transition: background-color 0.15s ease, opacity 0.15s ease;
        width: fit-content;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .legend-item:hover {
        background-color: var(--bg-card-alt);
    }

    .legend-item span:last-child {
        color: var(--text-color);
        width: fit-content;
    }

    .legend-item.inactive {
        opacity: 0.35;
    }

    .legend-color, #gen-mas, #gen-fem, #reg-diurno, #reg-noturno, #gauge-color {
        width: 12px;
        height: 12px;
        border-radius: 2px;
        flex-shrink: 0;
        width: 12px;
    }

    .chart-plot {
        flex: 1;
        display: flex;
        gap: 10px;
        min-height: 130px;
        padding-top: 6px;
    }

    .chart-yaxis {
        width: 34px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-end;
        padding-bottom: 1px;
    }

    .yaxis-label {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        color: var(--grey-muted);
        line-height: 1;
        width: fit-content;
        transform: translateY(4px);
    }

    .yaxis-label:first-child {
        transform: translateY(0);
    }

    .yaxis-label:last-child {
        transform: translateY(8px);
    }

    .chart-area {
        position: relative;
        flex: 1;
    }

    .chart-grid {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .grid-line {
        width: 100%;
        border-top: 1px solid var(--border-light);
        height: 0;
    }

    .grid-line.baseline {
        border-top: 1px solid var(--border-medium);
    }

    .chart-bars {
        position: absolute;
        inset: 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 6px;
    }

    .bar-group {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 100%;
        cursor: pointer;
        width: auto;
    }

    .bar-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: flex-end;
        justify-content: center;
    }

    .bar-pill {
        width: 52%;
        max-width: 26px;
        min-height: 3px;
        border-radius: 3px 3px 1px 1px;
        background-color: var(--border-light);
        display: flex;
        flex-direction: column-reverse;
        overflow: hidden;
        transition: height 0.35s ease, opacity 0.15s ease;
    }

    .bar-group:not(.active) .bar-pill {
        opacity: 0.92;
    }

    .bar-segment {
        width: 100%;
        transition: opacity 0.2s ease;
    }

    .bar-label {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        font-weight: 500;
        color: var(--grey-muted);
        margin-top: 8px;
        transition: color 0.2s ease;
        white-space: nowrap;
        width: fit-content;
    }

    .bar-group.active .bar-label {
        color: var(--text-color-strong);
        font-weight: 700;
    }

    .chart-hint {
        text-align: center;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        color: var(--grey-muted);
        margin-top: 4px;
        font-weight: 500;
        width: 100%;
    }

    .chart-tooltip {
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%) translateY(4px);
        background-color: var(--bg-card);
        border-radius: 8px;
        padding: 9px 12px;
        box-shadow: 0 6px 16px var(--shadow-color-strong);
        border: 1px solid var(--border-light);
        min-width: 150px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s ease, transform 0.15s ease;
        z-index: 20;
    }

    .bar-group.active .chart-tooltip {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .tooltip-date {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: 700;
        color: var(--text-color-strong);
        margin-bottom: 6px;
        white-space: nowrap;
        width: auto;
    }

    .tooltip-row {
        display: flex;
        align-items: center;
        gap: 7px;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        color: var(--text-color);
        padding: 2px 0;
        white-space: nowrap;
        width: auto;
    }

    .tooltip-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .tooltip-row span:last-child {
        margin-left: auto;
        font-weight: 700;
        color: var(--text-color-strong);
        width: auto;
    }

    .tooltip-total {
        display: flex;
        justify-content: space-between;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: 700;
        color: var(--text-color-strong);
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid var(--border-light);
        white-space: nowrap;
        gap: 14px;
        width: auto;
    }

    .totalsPanelTitle {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        color: var(--grey-muted);
        font-weight: 600;
        text-transform: uppercase;
    }

    .totalRow {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-light);
    }

    .totalRow:last-child {
        border-bottom: none;
    }

    .totalRow p.totalLabel {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        color: var(--text-color);
        width: auto;
    }

    .totalRow p.totalValue {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 13px;
        font-weight: 700;
        color: var(--text-color-strong);
        width: fit-content;
    }

    .rightCardElement2 {
        width: 100%;
        display: flex;
        gap: 10px;
        flex: 1;
    }

    .middleCard {
        height: 100%;
        padding: 18px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        justify-content: center;
    }

    .metricTitle {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        color: var(--grey-muted);
        font-weight: 600;
        text-transform: uppercase;
        width: auto;
    }

    .metricValue {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 26px;
        font-weight: 700;
        color: var(--text-color-strong);
        width: fit-content;
    }

    .metricVariation {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-color);
        width: fit-content;
    }

    .metricVariation.negative {
        color: var(--grey-muted);
    }

    .rightCardElement3 {
        width: 100%;
        flex: 1.75;
        display: flex;
        gap: 10px;
    }

    .cardHeading {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 13px;
        font-weight: 700;
        color: var(--text-color-strong);
        width: auto;
    }

    .mapImage {
        width: 100%;
        height: auto;
        object-fit: contain;
        margin-top: 6px;
    }

    .distributionList {
        display: flex;
        flex-direction: column;
        gap: 10px;
        flex: 1;
        justify-content: center;
    }

    .distributionRow {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .distributionLabels {
        display: flex;
        justify-content: space-between;
    }

    .distributionLabels span {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        color: var(--text-color);
        width: fit-content;
    }

    .distributionBarTrack {
        height: 6px;
        background-color: var(--border-light);
        border-radius: 4px;
        overflow: hidden;
    }

    .distributionBarFill {
        height: 100%;
        border-radius: 4px;
    }

    .gaugeCard {
        align-items: center;
        justify-content: space-between;
    }

    .gaugeWrapper {
        position: relative;
        width: 110px;
        height: 110px;
        align-self: center;
    }

    #gaugeChart {
        width: 100%;
        height: 100%;
    }

    .gaugeValue {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-family: Arial, Helvetica, sans-serif;
        font-size: 20px;
        font-weight: 700;
        color: var(--text-color-strong);
        width: fit-content;
    }

    .gaugeCaption {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        color: var(--grey-muted);
        text-align: center;
        width: 100%;
    }

    #gaugeProgress {
        transition: stroke-dashoffset 0.1s linear;
    }

    .goalsList {
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1;
        justify-content: center;
    }

    .goalRow {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .goalLabels {
        display: flex;
        justify-content: space-between;
    }

    .goalLabels span {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        color: var(--text-color);
        width: fit-content;
    }

    .goalBarTrack {
        height: 8px;
        background-color: var(--border-light);
        border-radius: 4px;
        overflow: hidden;
    }

    .goalBarFill {
        height: 100%;
        background-color: var(--bar-strong);
        border-radius: 4px;
    }

    .summaryHeader {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .summaryHeader p.summaryTitle {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 13px;
        font-weight: 700;
        color: var(--text-color-strong);
        width: auto;
    }

    .summaryHeader span.summaryTag {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        font-weight: 600;
        color: var(--grey-muted);
        background-color: var(--bg-card-alt);
        padding: 3px 8px;
        border-radius: 6px;
        width: fit-content;
    }

    .summaryUser {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .summaryUser .userImage {
        width: 50px;
    }

    .summaryUser p.summaryName {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-color-strong);
        width: auto;
    }

    .summaryUser p.summaryRole {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        color: var(--grey-muted);
        width: auto;
    }

    .quickActions {
        display: flex;
        gap: 8px;
        justify-content: space-between;
    }

    .quickActionBtn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        background-color: var(--bg-card-alt);
        border: none;
        border-radius: 12px;
        padding: 10px 4px;
        cursor: pointer;
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .quickActionBtn:hover {
        border: 1px solid var(--border-medium);
    }

    .quickActionBtn span {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        font-weight: 600;
        color: var(--text-color);
        width: auto;
    }

    .activityList {
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
        overflow-y: auto;
    }

    .activityRow {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-light);
    }

    .activityRow:last-child {
        border-bottom: none;
    }

    .activityInfo {
        display: flex;
        flex-direction: column;
        width: auto;
    }

    .activityInfo p.activityName {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-color-strong);
        width: auto;
    }

    .activityInfo p.activityDate {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        color: var(--grey-muted);
        width: auto;
    }

    .activityTotal {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: 700;
        color: var(--text-color-strong);
        width: fit-content;
    }

    /* ================= WELCOME FLAG ================= */

    /* ================= WELCOME FLAG (overlay) ================= */
    .welcome-flag {
        position: fixed;
        inset: 0;                     /* ocupa toda a tela */
        z-index: 9999;
        background: var(--welcome-overlay);  /* cor definida nas variáveis */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 2rem;
        opacity: 0;                  /* invisível por padrão */
        visibility: hidden;
        transition: opacity 0.6s ease, visibility 0.6s ease;
        backdrop-filter: blur(6px);  /* efeito de desfoque no fundo */
        font-family: Arial, Helvetica, sans-serif;
    }

    .welcome-flag.show {
        opacity: 1;
        visibility: visible;
    }

    .welcome-flag .welcome-content {
        max-width: 700px;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(4px);
        padding: 2.5rem 3rem;
        border-radius: 32px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.15);
        position: relative;
        animation: welcomePulse 1.2s ease-out;
        text-align: center;
    }

    .welcome-flag h1 {
        font-size: clamp(1.8rem, 5vw, 3.2rem);
        font-weight: 700;
        color: #fff;
        line-height: 1.3;
        margin: 0 0 0.5rem;
        text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    }

    .welcome-flag .welcome-sub {
        font-size: clamp(1rem, 2vw, 1.3rem);
        color: rgba(255, 255, 255, 0.8);
        font-weight: 400;
        margin-bottom: 1.8rem;
        letter-spacing: 0.3px;
    }

    .welcome-flag .close-welcome {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.25);
        color: #fff;
        padding: 0.6rem 1.8rem;
        border-radius: 40px;
        font-size: 0.95rem;
        font-weight: 600;
        text-align: center;
        cursor: pointer;
        transition: all 0.25s ease;
        backdrop-filter: blur(4px);
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-top: 0.5rem;
    }

    .welcome-flag .close-welcome:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.04);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .welcome-flag .close-welcome i {
        font-size: 20px;
        text-align: center;
    }

    /* Ícone decorativo opcional */
    .welcome-flag .welcome-icon {
        font-size: 4rem;
        margin-bottom: 0.8rem;
        color: #fbbf24;
    }

    /* Animação de entrada */
    @keyframes welcomePulse {
        0% {
            transform: scale(0.92);
            opacity: 0;
        }
        60% {
            transform: scale(1.02);
        }
        100% {
            transform: scale(1);
            opacity: 1;
        }
    }

    /* Responsividade */
    @media (max-width: 600px) {
        .welcome-flag .welcome-content {
            padding: 1.8rem 1.5rem;
            border-radius: 24px;
        }
        .welcome-flag h1 {
            font-size: 1.8rem;
        }
    }

    /* ================================================================
    PÁGINA: CANDIDATOS · GERAL (candidatos-geral.html)
    ================================================================ */

    .candidatosGeralPage .mainContent {
        padding: 16px 20px;
    }

    .backLink {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-color-strong);
        text-decoration: none;
        padding: 8px 16px 8px 8px;
        border-radius: 30px;
        background-color: var(--bg-card);
        box-shadow: 0 1px 3px var(--shadow-color);
        transition: background 0.2s, transform 0.1s;
        width: fit-content;
        margin-bottom: 10px;
    }

    .backLink:hover {
        background-color: var(--bg-card-alt);
        transform: translateX(-4px);
    }

    .backLink i {
        font-size: 22px;
    }

    .candidatosGeralPage .section2 {
        flex: 1;
        min-height: 0;
    }

    .candidatosGeralPage .section2-leftside {
        flex: 3;
    }

    .candidatosGeralPage .section2-rightside {
        flex: 1.2;
    }

    /* cartões de métricas resumo (reutiliza .middleCard/.flutuantModel) */
    .summaryMetricsRow {
        width: 100%;
        display: flex;
        gap: 10px;
        flex-shrink: 0;
    }

    /* cartão da tabela geral */
    .tableCard {
        padding: 18px;
        background-color: white;
        border-radius: 20px;
        box-shadow: 1px 1px 1px var(--shadow-color-strong);
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1;
        min-height: 0;
    }

    .tableCard .cardHeading {
        margin-bottom: 2px;
    }

    .tableScroll {
        flex: 1;
        overflow: auto;
        border-radius: 12px;
    }

    table.candTable {
        width: 100%;
        border-collapse: collapse;
        font-family: Arial, Helvetica, sans-serif;
    }

    table.candTable thead th {
        position: sticky;
        top: 0;
        background-color: var(--bg-card-alt);
        color: var(--grey-muted);
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        padding: 10px 8px;
        text-align: center;
        border-bottom: 1px solid var(--border-medium);
        white-space: nowrap;
    }

    table.candTable thead tr.grouw th {
        background-color: var(--bg-card-alt);
        font-size: 11px;
    }

    table.candTable thead th.uoCol {
        text-align: left;
        width: auto;
    }

    table.candTable tbody td {
        padding: 9px 8px;
        font-size: 12.5px;
        color: var(--text-color);
        text-align: center;
        border-bottom: 1px solid var(--border-light);
        white-space: nowrap;
    }

    table.candTable tbody td.uoCol {
        text-align: left;
        font-weight: 600;
        color: var(--text-color-strong);
    }

    table.candTable tbody tr:hover td {
        background-color: var(--bg-card-alt);
    }

    table.candTable tbody td.totalCol {
        font-weight: 700;
        color: var(--text-color-strong);
    }

    table.candTable tfoot td {
        padding: 10px 8px;
        font-size: 12.5px;
        font-weight: 700;
        text-align: center;
        background-color: var(--active-bg);
        color: var(--text-color-strong);
        border-top: 1px solid var(--border-medium);
        white-space: nowrap;
    }

    table.candTable tfoot td.uoCol {
        text-align: left;
    }

    /* cartão de distribuição por género (reutiliza estilo de rankingCard) */
    .genderCard {
        padding: 18px;
        background-color: var(--bg-card);
        border-radius: 20px;
        box-shadow: 1px 1px 1px var(--shadow-color-strong);
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .genderBarOuter {
        width: 100%;
        height: 14px;
        border-radius: 8px;
        overflow: hidden;
        display: flex;
        background-color: var(--border-light);
    }

    .genderBarOuter .segM {
        height: 100%;
        background-color: var(--bar-strong);
    }

    .genderBarOuter .segF {
        height: 100%;
        background-color: var(--bar-light);
    }

    .genderLegend {
        display: flex;
        justify-content: space-between;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11.5px;
        color: var(--text-color);
    }

    .genderLegend .legendDot {
        width: 8px;
        height: 8px;
        border-radius: 2px;
        display: inline-block;
        margin-right: 6px;
    }

    /* ranking por unidade orgânica (reutiliza padrão de rankingCard) */
    .rankingCard {
        padding: 18px;
        background-color: var(--bg-card);
        border-radius: 20px;
        box-shadow: 1px 1px 1px var(--shadow-color-strong);
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1;
        min-height: 0;
    }

    .rankingCard .cardHeading {
        margin-bottom: 4px;
    }

    .rankingList {
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex: 1;
        overflow-y: auto;
    }

    .rankingItem {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border-radius: 8px;
        background-color: var(--bg-card-alt);
        transition: background 0.15s;
    }

    .rankingItem .rankPos {
        font-weight: 700;
        color: var(--grey-muted);
        width: 28px;
        flex-shrink: 0;
    }

    .rankingItem .rankName {
        flex: 1;
        display: inline-block;
        font-weight: 600;
        color: var(--text-color-strong);
    }

    .rankingItem .rankCandidates {
        display: flex;
        justify-content: flex-end;
        font-weight: 700;
        color: var(--text-color-strong);
    }

    .rankingItem.top1 {
        background: #f6e9d0;
    }

    .rankingItem.top2 {
        background: #f0f0f0;
    }

    .rankingItem.top3 {
        background: #f5e6d3;
    }

    body.dark-mode .rankingItem.top1 {
        background: #3a2e1e;
    }

    body.dark-mode .rankingItem.top2 {
        background: #2a2a2a;
    }

    body.dark-mode .rankingItem.top3 {
        background: #3a2820;
    }

    .exportRow {
        display: flex;
        gap: 8px;
    }

    .exportBtn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border-radius: 10px;
        border: 1px solid var(--border-light);
        background-color: var(--bg-card-alt);
        color: var(--text-color-strong);
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.18s ease;
    }

    .exportBtn:hover {
        background-color: var(--active-bg);
    }

    .exportBtn i {
        font-size: 16px;
    }

    

    /* ================= RESPONSIVE (geral) ================= */

    @media (max-width: 768px) {
        .section2 {
            flex-direction: column;
        }

        .section2-leftside,
        .section2-rightside {
            flex: none;
            width: 100%;
        }

        .rightCardElement1 {
            flex-direction: column;
        }

        .card1 {
            border-right: none;
            border-bottom: 3px solid var(--border-medium);
            border-radius: 30px 30px 0 0;
        }

        .card2 {
            border-radius: 0 0 30px 30px;
        }

        .rightCardElement2,
        .rightCardElement3 {
            flex-direction: column;
        }

        .chart-headline {
            width: 100%;
        }
    }

    @media (max-width: 480px) {
        #topNavBar {
            gap: 10px;
        }

        .searchSec {
            display: none;
            position: absolute;
            top: 60px;
            left: 20px;
            right: 20px;
            width: auto;
            z-index: 30;
        }

        .searchSec.searchOpen {
            display: flex;
        }

        .iconModel.searchToggleBtn {
            display: flex;
            width: 40px;
            height: 40px;
        }

        .userInfoModel p,
        .userInfoModel .userName {
            display: none;
        }

        .userInfoModel {
            min-width: fit-content;
            padding: 0;
        }

        h2 {
            display: none;
        }
    }

    a {
        text-decoration: none;
    }

    #textMap{
        text-align: center;
    }

    #titleMap{
        font-size: 28px;
    }

    .mapBadge{
        font-size: 10px;
    }

    .material-icons{
        padding: 4px 2px;
    }

    .rankingList{
        font-family: Arial, Helvetica, sans-serif;
        font-size: 13px;
        display: flex;
        justify-content: space-between;

    }

    /* ===== PÁGINA CANDIDATOS GERAL ===== */
    .candidatosGeralPage .summaryMetricsRow {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    .candidatosGeralPage .summaryMetricsRow .middleCard {
        flex: 1 1 200px;
    }

    .backLink {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        margin-bottom: 1.2rem;
        color: var(--text-color);
        text-decoration: none;
        font-weight: 500;
    }
    .backLink i {
        font-size: 20px;
    }

    .tableCard {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 1.2rem 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    .tableScroll {
        overflow-x: auto;
        margin-top: 0.8rem;
    }
    .candTable {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
    }
    .candTable th, .candTable td {
        padding: 8px 10px;
        text-align: center;
        border-bottom: 1px solid var(--border-light);
    }
    .candTable thead th {
        background: var(--table-header-bg, #f5f5f5);
        font-weight: 600;
        color: var(--text-color);
    }
    .candTable .uoCol {
        text-align: left;
        font-weight: 500;
    }
    .candTable .totalCol {
        font-weight: 700;
    }
    .candTable tfoot tr {
        background: var(--table-footer-bg, #fafafa);
        font-weight: 700;
    }
    .candTable tfoot .uoCol {
        font-weight: 700;
    }

    .exportRow {
        display: flex;
        gap: 0.6rem;
        align-items: center;
    }
    .exportBtn {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: transparent;
        border: 1px solid var(--border-light);
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 13px;
        cursor: pointer;
        color: var(--text-color);
    }
    .exportBtn i {
        font-size: 18px;
    }

    .genderCard {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 1.2rem 1rem;
        margin-bottom: 1.5rem;
    }
    .genderBarOuter {
        height: 20px;
        background: var(--border-light);
        border-radius: 10px;
        margin: 0.8rem 0;
        overflow: hidden;
    }
    .genderLegend {
        display: flex;
        justify-content: space-around;
        font-size: 13px;
    }
    .legendDot {
        display: inline-block;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        margin-right: 6px;
    }

    .rankingCard {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 1.2rem 1rem;
    }
    .rankingList {
        margin-top: 0.6rem;
    }
    .rankingItem {
        display: flex;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--border-light);
    }
    .rankingItem .rankPos {
        width: 32px;
        font-weight: 600;
        color: var(--grey-muted);
    }
    .rankingItem .rankName {
        flex: 1;
        font-weight: 500;
    }
    .rankingItem .rankCandidates {
        font-weight: 700;
    }
    .rankingItem.top1 .rankPos { color: gold; }
    .rankingItem.top2 .rankPos { color: silver; }
    .rankingItem.top3 .rankPos { color: #cd7f32; }

    /* ===== DARK MODE ===== */
    body.dark-mode .candTable thead th {
        background: #2a2a2a;
    }
    body.dark-mode .candTable tfoot tr {
        background: #1f1f1f;
    }
    body.dark-mode .exportBtn {
        border-color: #444;
    }

    /* ===== Cartões com fundo branco ===== */
    .flutuantModel {
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        padding: 1.5rem;
        transition: box-shadow 0.2s ease;
    }

    /* Modo escuro */
    .dark-mode .flutuantModel {
        background: #1e1e2f;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    /* Cartões específicos */
    .tableCard,
    .genderCard,
    .rankingCard {
        background: #ffffff;
        border-radius: 16px;
        padding: 1.5rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
        margin-bottom: 1.5rem;
    }

    .dark-mode .tableCard,
    .dark-mode .genderCard,
    .dark-mode .rankingCard {
        background: #1e1e2f;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    /* Tabela */
    .candTable {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.9rem;
    }
    .candTable th,
    .candTable td {
        padding: 0.75rem 0.5rem;
        text-align: center;
        border-bottom: 1px solid #e9ecf1;
    }
    .dark-mode .candTable th,
    .dark-mode .candTable td {
        border-color: #333;
    }
    .candTable .uoCol {
        text-align: left;
        font-weight: 500;
    }
    .candTable .totalCol {
        font-weight: 700;
        color: var(--bar-strong);
    }
    .candTable tfoot td {
        font-weight: 700;
        border-top: 2px solid #ccc;
    }
    .dark-mode .candTable tfoot td {
        border-color: #555;
    }

    /* Barra de género */
    .genderBarOuter {
        display: flex;
        height: 20px;
        border-radius: 20px;
        overflow: hidden;
        background: #e9ecf1;
        margin: 1rem 0;
    }
    .dark-mode .genderBarOuter {
        background: #2a2a3a;
    }
    .genderBarSeg {
        height: 100%;
        transition: width 0.5s ease;
    }
    .genderLegend {
        display: flex;
        justify-content: space-around;
        font-size: 0.9rem;
    }

    /* Ranking */
    .rankingItem {
        display: flex;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f2f5;
    }
    .dark-mode .rankingItem {
        border-color: #2a2a3a;
    }
    .rankPos {
        width: 30px;
        font-weight: 600;
        color: #999;
    }
    .rankName {
        flex: 1;
        font-weight: 500;
    }
    .rankCandidates {
        font-weight: 600;
        color: var(--bar-strong);
    }
    .rankingItem.top1 .rankPos { color: #f5a623; }
    .rankingItem.top2 .rankPos { color: #aaa; }
    .rankingItem.top3 .rankPos { color: #cd7f32; }

    /* Métricas resumo */
    .summaryMetricsRow {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    .middleCard {
        background: #ffffff;
        border-radius: 16px;
        padding: 1.25rem 1.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }
    .dark-mode .middleCard {
        background: #1e1e2f;
    }
    .metricTitle {
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #494848;
    }

    .dark-mode .metricTitle{
        color: white;
    }

    #Cand{
        color: white;
    }
    .metricValue {
        font-size: 2rem;
        font-weight: 700;
        margin: 0.25rem 0;
    }
    .metricVariation {
        font-size: 0.75rem;
        color: #888;
    }

    /* ===== PÁGINA PROVÍNCIAS ===== */
    .provincePage .mainContent {
        padding: 16px 20px;
    }
    .backLink {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-color-strong);
        text-decoration: none;
        padding: 8px 16px 8px 8px;
        border-radius: 30px;
        background-color: var(--bg-card);
        box-shadow: 0 1px 3px var(--shadow-color);
        transition: background 0.2s, transform 0.1s;
        width: fit-content;
        margin-bottom: 10px;
    }
    .backLink:hover {
        background-color: var(--bg-card-alt);
        transform: translateX(-4px);
    }
    .backLink i {
        font-size: 22px;
    }
    .provincePage .section2 {
        flex: 1;
        min-height: 0;
    }
    .provincePage .section2-leftside {
        flex: 3;
    }
    .provincePage .section2-rightside {
        flex: 1.2;
    }
    .provinceMapCard {
        padding: 18px;
        background-color: var(--bg-card);
        border-radius: 20px;
        box-shadow: 1px 1px 1px var(--shadow-color-strong);
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
        min-height: 0;
    }
    .provinceMapCard .mapWrapper {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 300px;
    }
    .provinceMapCard .mapWrapper svg {
        width: 100%;
        height: 100%;
        max-height: 560px;
        object-fit: contain;
    }
    .mapBadge {
        font-size: 10px;
        color: var(--grey-muted);
        background: var(--bg-card-alt);
        padding: 4px 12px;
        border-radius: 20px;
    }
    .rankingCard {
        padding: 18px;
        background-color: var(--bg-card);
        border-radius: 20px;
        box-shadow: 1px 1px 1px var(--shadow-color-strong);
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1;
        min-height: 0;
    }
    .rankingList {
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex: 1;
        overflow-y: auto;
    }
    .rankingItem {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border-radius: 8px;
        background-color: var(--bg-card-alt);
        transition: background 0.15s;
    }
    .rankingItem .rankPos {
        font-weight: 700;
        color: var(--grey-muted);
        width: 28px;
        flex-shrink: 0;
    }
    .rankingItem .rankName {
        flex: 1;
        font-weight: 600;
        color: var(--text-color-strong);
    }
    .rankingItem .rankCandidates {
        font-weight: 700;
        color: var(--text-color-strong);
    }
    .rankingItem.top1 {
        background: #f6e9d0;
    }
    .rankingItem.top2 {
        background: #f0f0f0;
    }
    .rankingItem.top3 {
        background: #f5e6d3;
    }
    .dark-mode .rankingItem.top1 {
        background: #3a2e1e;
    }
    .dark-mode .rankingItem.top2 {
        background: #2a2a2a;
    }
    .dark-mode .rankingItem.top3 {
        background: #3a2820;
    }
    .tooltipMapa {
        position: fixed;
        background-color: #000;
        color: #fff;
        padding: 10px;
        border-radius: 6px;
        max-width: 250px;
        z-index: 1000;
        display: none;
        font-size: 14px;
    }
    .tooltipsMaps {
        fill: #faa41a;
        cursor: pointer;
    }
    .tooltipsMaps:hover {
        fill: #D7181E;
    }
    @media (max-width: 768px) {
        .provincePage .section2 {
            flex-direction: column;
        }
        .provincePage .section2-leftside,
        .provincePage .section2-rightside {
            flex: none;
            width: 100%;
        }
    }

    .chart-legend-row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 10px;
    }
    .legend-item {
        display: flex;
        align-items: center;
        font-size: 12px;
    }
    .legend-color {
        width: 12px;
        height: 12px;
        border-radius: 3px;
        margin-right: 5px;
    }
    .chart-plot {
        display: flex;
        height: 200px;
    }
    .chart-yaxis {
        display: flex;
        flex-direction: column-reverse;
        justify-content: space-between;
        margin-right: 8px;
        font-size: 10px;
    }
    .chart-area {
        flex: 1;
        position: relative;
    }
    .chart-bars {
        display: flex;
        align-items: flex-end;
        height: 100%;
        gap: 8px;
    }
    .bar-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 100%;
        justify-content: flex-end;
    }
    .bar {
        width: 100%;
        min-height: 2px;
        border-radius: 4px 4px 0 0;
        transition: height 0.3s;
    }
    .bar-label {
        font-size: 9px;
        margin-top: 4px;
        text-align: center;
        transform: rotate(-30deg);
        white-space: nowrap;
    }
    .distributionList, .activityList {
        margin-top: 10px;
    }
    .distributionItem, .activityItem {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid #eee;
    }

    .mapHeader{
        text-align: center;
    }
    .dark-mode .mapHeader{
        color: white;
    }
    .mapTitle {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 20px;
        font-weight: 700;
        color: var(--text-color-strong);
        width: auto;
    }

    .mapDesc {
        font-size: 14px;
        font-family: Arial, Helvetica, sans-serif;
        text-align: center;
    }

    /* ===== MODAL GRÁFICOS (antigo, usado noutra funcionalidade) ===== */
    .chartsModal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.6);
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(4px);
    }
    .chartsModal-content {
        background: var(--bg-card);
        border-radius: 24px;
        width: 90%;
        max-width: 900px;
        max-height: 90vh;
        padding: 2rem;
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
        overflow-y: auto;
        position: relative;
    }
    .chartsModal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
    }
    .chartsModal-header h2 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text-color-strong);
        width: auto;
    }
    .closeModalBtn {
        background: transparent;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        color: var(--grey-muted);
        transition: color 0.2s;
        width: auto;
    }
    .closeModalBtn:hover {
        color: var(--text-color-strong);
    }
    .chartToggleRow {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        justify-content: center;
    }
    .chartToggleBtn {
        padding: 0.5rem 1.5rem;
        border-radius: 30px;
        border: 1px solid var(--border-light);
        background: transparent;
        color: var(--text-color);
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }
    .chartToggleBtn.active {
        background: var(--bar-strong);
        color: white;
        border-color: var(--bar-strong);
    }
    .chartToggleBtn:hover {
        background: var(--active-bg);
    }
    .chartContainer {
        position: relative;
        height: 400px;
        width: 100%;
    }
    .chartContainer canvas {
        width: 100% !important;
        height: 100% !important;
    }
    #chartLegendCustom {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        margin-top: 1.2rem;
    }
    .legendColorBox {
        display: inline-block;
        width: 14px;
        height: 14px;
        border-radius: 4px;
        margin-right: 6px;
    }
    .legendLabel {
        font-size: 13px;
        color: var(--text-color);
    }

    /* ===== BOTÃO "GRÁFICOS"  ===== */
    .graficosBtn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px;
        border: none;
        border-radius: 10px;
        background: var(--bar-strong);
        color: #fff;
        font-weight: 600;
        cursor: pointer;
        margin-top: 12px;
        transition: opacity 0.2s;
    }
    .graficosBtn:hover { opacity: 0.85; }

    /* ===== MODAL: DIURNO VS PÓS-LABORAL POR FACULDADE ===== */
    .modalOverlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }
    .modalOverlay.open { display: flex; }

    .modalBox {
        background: var(--bg-card);
        border-radius: 14px;
        padding: 24px;
        width: min(560px, 90vw);
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 20px 40px var(--shadow-color-strong);
    }
    .modalHeader {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }
    .modalTitle {
        font-weight: 600;
        font-size: 1.1rem;
        color: var(--text-color-strong);
    }
    .modalCloseBtn {
        border: none;
        background: transparent;
        cursor: pointer;
        color: var(--grey-muted);
        transition: color 0.2s ease;
        display: flex;
        justify-content: end;
    }
    .modalCloseBtn:hover {
        color: var(--text-color-strong);
    }
    .modalLegend {
        display: flex;
        gap: 16px;
        margin-bottom: 16px;
        font-size: 0.85rem;
        color: var(--text-color);
    }

    .regimeChartRow { margin-bottom: 16px; }
    .regimeChartLabel {
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 6px;
        color: var(--text-color-strong);
    }
    .regimeBarGroup { display: flex; flex-direction: column; gap: 4px; }
    .regimeBarWrapper {
        position: relative;
        background: var(--border-light);
        border-radius: 6px;
        height: 22px;
        overflow: hidden;
    }
    .regimeBar { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
    .regimeBarValue {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.75rem;
        font-weight: 600;
        color: #fff;
        text-shadow: 0 0 2px rgba(0,0,0,0.4);
    }

    /* ===== GRÁFICO REGIME – MELHORIAS ===== */

    :root {
        /* cinza médio - claro */
    }
    body.dark-mode {
    --regime-diurno: #5dade2;      /* azul claro - escuro */
    --regime-noturno: #bdc3c7;     /* cinza claro - escuro */
    }

    .modalBox {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    }

    .regimeBarWrapper {
    background: var(--border-light);
    border-radius: 6px;
    height: 28px;                  /* um pouco mais alto */
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease;
    }

    .regimeBar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.4s ease, background-color 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    }

    .regimeBarValue {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    pointer-events: none;
    z-index: 2;
    }

    /* Ajuste para o modo escuro – as barras são mais claras, então o texto deve ser escuro */
    body.dark-mode .regimeBarValue {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(255,255,255,0.3);
    }

    /* Para barras muito curtas (< 20% de largura), colocar o valor à direita da barra */
    .regimeBarWrapper .regimeBarValue.outside {
    right: auto;
    left: calc(100% + 6px);
    color: var(--text-color-strong);
    text-shadow: none;
    }

    /* Cores específicas para cada barra */
    .regimeBar.diurno {
    background-color: var(--regime-diurno);
    }
    .regimeBar.noturno {
    background-color: var(--regime-noturno);
    }

    /* Legenda do modal */
    .modalLegend {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: var(--text-color);
    }
    .modalLegend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    }
    .legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    }
    .legend-color.diurno {
    background: var(--regime-diurno);
    }
    .legend-color.noturno {
    background: var(--regime-noturno);
    }

    /* Botão "Gráficos" – sempre preto, independente do tema */
    .graficosBtn {
    background: #111 !important;      /* preto absoluto */
    color: #fff !important;
    border: none;
    transition: opacity 0.25s ease, transform 0.15s ease;
    }
    .graficosBtn:hover {
    opacity: 0.85;
    transform: scale(1.02);
    }
    .graficosBtn:active {
    transform: scale(0.97);
    }
    /* Botão "Gráficos" – sempre preto com ícone branco */
    .graficosBtn {
    background: #111 !important;
    color: #fff !important;
    border: none;
    transition: opacity 0.25s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 10px;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    }
    .graficosBtn:hover {
    opacity: 0.85;
    transform: scale(1.02);
    }
    .graficosBtn:active {
    transform: scale(0.97);
    }

    /* Ícone dentro do botão – sempre branco */
    .graficosBtn i {
    color: #fff !important;
    font-size: 22px; /* opcional, ajuste conforme desejar */
    }

    .regimeBar.masculino {
        background-color: var(--genero-masc);
    }
    .regimeBar.feminino {
        background-color: var(--genero-fem);
    }

    /* --- Modal Overlay --- */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        backdrop-filter: blur(2px);
    }

    /* --- Caixa do Modal --- */
    .modal-box {
        background: #fff;
        padding: 30px 40px 25px;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
        max-width: 400px;
        width: 90%;
        text-align: center;
        position: relative;
        animation: fadeIn 0.3s ease;
    }

    /* Animação de entrada */
    @keyframes fadeIn {
        from { transform: scale(0.9); opacity: 0; }
        to   { transform: scale(1); opacity: 1; }
    }

    /* Botão fechar (X) */
    .modal-fechar {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 28px;
        font-weight: bold;
        color: #aaa;
        cursor: pointer;
        transition: color 0.2s;
    }
    .modal-fechar:hover {
        color: #333;
    }

    /* Ícone */
    .modal-icon {
        margin-bottom: 10px;
    }

    /* Mensagem */
    .modal-mensagem {
        font-size: 18px;
        color: #333;
        margin: 15px 0 20px;
        line-height: 1.4;
    }

    /* Botão OK */
    .modal-btn {
        background: #2c3e50;
        color: #fff;
        border: none;
        padding: 10px 30px;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
        transition: background 0.2s;
    }
    .modal-btn:hover {
        background: #1a252f;
    }

    /* --- Tema escuro (se usares dark-mode) --- */
    .dark-mode .modal-box {
        background: #2d2d2d;
    }
    .dark-mode .modal-mensagem {
        color: #eee;
    }
    .dark-mode .modal-fechar {
        color: #888;
    }
    .dark-mode .modal-fechar:hover {
        color: #fff;
    }
    .dark-mode .modal-btn {
        background: #3d566e;
    }
    .dark-mode .modal-btn:hover {
        background: #2c4055;
    }

    .modal-fechar{
        display: flex;
        justify-content: end;
    }

    /* ================= MOBILE SIDEBAR OVERLAY ================= */

    /* Overlay escuro que cobre o conteúdo */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 999;
        display: none;
        transition: opacity 0.3s ease;
        opacity: 0;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Botão de menu (hambúrguer) – visível apenas em mobile */
    .menuToggleBtn {
        display: none; /* oculto por padrão */
        width: 50px;
        height: 44px;
        cursor: pointer;
        background-color: var(--bg-card);
        border-radius: 10px;
        box-shadow: 0 1px 2px var(--shadow-color);
        justify-content: center;
        align-items: center;
        transition: background-color 0.3s;
    }

    .menuToggleBtn i {
        font-size: 28px;
        color: var(--text-color-strong);
    }

    @media (max-width: 1024px) {
        /* Mostra o botão hambúrguer */
        .menuToggleBtn {
            display: flex !important;
        }

        /* Sidebar em mobile: igual à desktop expandida */
        .sideNavBar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        transform: translateX(-100%) !important;
        width: 280px !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 1000 !important;
        transition: transform 0.3s ease !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3) !important;
        border-radius: 0 !important;
        padding: 20px 16px !important;
        display: flex !important;
        flex-direction: column !important;
        background-color: var(--bg-card) !important;
        align-items: stretch !important;
        visibility: hidden !important;
    }

    .sideNavBar.sidebar-open {
        transform: translateX(0) !important;
        visibility: visible !important;
        background-color: var(--sidebar-bg) !important;
    }

        /* Remove qualquer efeito do collapsed em mobile */
        .sideNavBar.collapsed,
        .sideNavBar.collapsed .sideMenuItem,
        .sideNavBar.collapsed .sideMenuItemHeader {
            width: 100% !important;
            justify-content: flex-start !important;
            align-items: stretch !important;
        }

        /* Mostra todos os textos e ícones normalmente (como no desktop) */
        .sideNavBar .itemName,
        .sideNavBar .chevron,
        .sideNavBar .navSectionLabel,
        .sideNavBar .navVersion {
            display: flex !important;
            white-space: nowrap !important;
        }

        

        .sideNavBar .sideMenuItem.open .subMenu {
            max-height: 600px !important; /* espaço para vários itens */
            overflow: visible !important;
            padding-bottom: 6px !important;
        }

        .sideNavBar .subMenuItem {
            display: block !important;
            padding: 9px 10px !important;
            font-size: 12.5px !important;
            color: var(--text-color) !important;
            width: 100% !important;
            border-left: 2px solid transparent !important;
            text-align: left !important;
            transition: background-color 0.18s ease !important;
        }
        .sideNavBar .subMenuItem:hover {
            background-color: var(--bg-card-alt) !important;
        }
        .sideNavBar .subMenuItem.activeSubMenuItem {
            background-color: var(--active-bg) !important;
            border-left: 2px solid var(--border-accent) !important;
            font-weight: 600 !important;
        }

        /* Ícone de expansão (chevron) */
        .sideNavBar .chevron {
            display: flex !important;
            margin-left: auto !important;
            transition: transform 0.25s ease !important;
        }
        .sideNavBar .sideMenuItem.open .chevron {
            transform: rotate(180deg) !important;
        }

        /* Oculta o botão de recolher (colapso) em mobile */
        .sidebarCollapseBtn {
            display: none !important;
        }

        /* Botão de fechar (X) – visível apenas em mobile */
        .sideNavBar .sidebar-close-btn {
            display: flex !important;
            align-self: flex-end;
            background: transparent !important;
            border: none !important;
            color: var(--text-color-strong) !important;
            font-size: 28px !important;
            cursor: pointer !important;
            padding: 4px 8px !important;
            margin-bottom: 10px !important;
            width: fit-content !important;
            z-index: 10 !important;
        }


        /* Blur do conteúdo quando sidebar aberta */
        .mainContent.blurred {
            filter: blur(3px);
            pointer-events: none;
            transition: filter 0.3s ease;
        }

        /* Rodapé da sidebar */
        .sideNavBar .sideNavFooter {
            margin-top: auto !important;
            padding-top: 10px !important;
            border-top: 1px solid var(--border-light) !important;
        }

        .sideNavBar .subMenu {
            position: static !important;
            top: auto !important;
            left: auto !important;
            right: auto !important;
            transform: none !important;
            display: block !important;
            width: 100% !important;
            max-height: 0 !important;
            overflow: hidden !important;
            transition: max-height 0.3s ease !important;
            padding-left: 38px !important;
            list-style: none !important;
            margin: 0 !important;
            box-shadow: none !important;
            background: transparent !important;
            border-radius: 0 !important;
        }

        .sideNavBar .sideMenuItem.open .subMenu {
            max-height: 600px !important;
            overflow: visible !important;
            padding-bottom: 6px !important;
        }

        /* Garante que o item pai também não force largura reduzida */
        .sideNavBar .sideMenuItem.hasSubMenu {
            position: static !important;
            width: 100% !important;
        }
    }

    @media (min-width: 1025px) {
    .sideNavBar .sidebar-close-btn {
        display: none !important;
    }
}
    /* ===== TABELA DE DEFICIÊNCIAS ===== */

    .deficiencia-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.9rem;
        font-family: Arial, Helvetica, sans-serif;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        border-radius: 12px;
        overflow: hidden;
    }

    .deficiencia-table thead {
        background-color: #f4f6fa;
        border-bottom: 2px solid var(--border-medium);
    }

    .deficiencia-table th {
        padding: 12px 10px;
        text-align: center;
        font-weight: 700;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: #4a4a4a;
        white-space: nowrap;
    }

    .deficiencia-table th:first-child {
        text-align: left;
        padding-left: 16px;
    }

    .deficiencia-table td {
        padding: 10px 10px;
        text-align: center;
        border-bottom: 1px solid var(--border-light);
        color: var(--text-color);
        transition: background-color 0.15s ease;
    }

    .deficiencia-table td:first-child {
        text-align: left;
        font-weight: 600;
        color: var(--text-color-strong);
        padding-left: 16px;
    }

    .deficiencia-table tbody tr:hover td {
        background-color: var(--bg-card-alt);
    }

    /* Zebra striping – linhas alternadas */
    .deficiencia-table tbody tr:nth-child(even) {
        background-color: rgba(0, 0, 0, 0.02);
    }

    .deficiencia-table tbody tr:last-child td {
        border-bottom: none;
    }

    /* Coluna de totais (última coluna) – destaque */
    .deficiencia-table td:last-child {
        font-weight: 700;
        color: var(--text-color-strong);
        background-color: var(--bg-card-alt);
    }

    /* Rodapé com totais globais (gerado pelo JS) */
    .deficiencia-table-footer {
        margin-top: 16px;
        padding: 12px 16px;
        background-color: var(--bg-card-alt);
        border-radius: 8px;
        font-weight: 600;
        text-align: right;
        color: var(--text-color-strong);
        border: 1px solid var(--border-light);
        font-size: 0.85rem;
    }

    body.dark-mode .deficiencia-table thead {
        background-color: #2a2a3a;
    }

    body.dark-mode .deficiencia-table th {
        color: #ccc;
        border-bottom-color: #444;
    }

    body.dark-mode .deficiencia-table td {
        border-bottom-color: #2a2a3a;
    }

    body.dark-mode .deficiencia-table tbody tr:nth-child(even) {
        background-color: rgba(255, 255, 255, 0.03);
    }

    body.dark-mode .deficiencia-table td:last-child {
        background-color: #252535;
    }

    body.dark-mode .deficiencia-table-footer {
        background-color: #252535;
        border-color: #333;
        color: #eee;
    }

    #deficienciaTableContainer {
        overflow-x: auto;
        max-height: 60vh;
        overflow-y: auto;
        padding-right: 4px;
    }

    .modalBox {
        width: min(700px, 92vw);  /* mais largo para acomodar mais colunas */
    }

    .dark-mode .regimeChartContainer{
        color: white;
    }

    #pdfTableContent.exporting-pdf {
        overflow: visible !important;
        width: 100% !important;
    }

    #pdfTableContent.exporting-pdf .candTable {
        width: 100% !important;
        min-width: 0 !important;
    }

    #pdfTableContent.exporting-pdf table {
        page-break-inside: auto;
    }

    #pdfTableContent.exporting-pdf tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    #pdfTableContent.exporting-pdf {
        overflow: visible !important;
        width: 100% !important;
    }

    #pdfTableContent.exporting-pdf .candTable {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: collapse;
    }

    #pdfTableContent.exporting-pdf tr {
        page-break-inside: avoid;
    }

    #pdfTableContent.exporting-pdf thead {
        display: table-header-group;
    }

    #pdfTableContent.exporting-pdf tfoot {
        display: table-footer-group;
    }
    /* ===== Coluna direita acompanhar a altura real da coluna esquerda ===== */

    .section2 {
        align-items: stretch; /* garante que ambas as colunas tenham a mesma altura */
    }

    .section2-leftside,
    .section2-rightside {
        height: auto;   /* remove o height:100% — deixa o stretch decidir */
        min-height: 0;
    }

    /* "Gráficos por Unidade Orgânicas" mantém a altura do seu conteúdo */
    .section2-rightside > .leftCardElement:first-child {
        flex: 0 0 auto;
    }

    /* "Ranking de Cursos" absorve TODO o espaço restante até ao fundo */
    .section2-rightside > .leftCardElement:last-child {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .activityList {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
    }

    .uo-card-img, .uo-card-img{
        width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: 8px;
        overflow: hidden;
        position: relative;
        margin-bottom: 12px;
        background: #fafafa;
    }

    #inscricoesPagasValue, #inscricoesNaoPagasValue{
        color: white;
    }
    /* ===== Cards Efetivos/Não Efetivos — fundo animado tipo "água do oceano" ===== */
    #candEfetivos, #candNaoEfetivos {
        color: white;
        position: relative;
        overflow: hidden;
        background: linear-gradient(
            120deg,
            #0a3d91,
            #1560c4,
            #2f8fd6,
            #1560c4,
            #0a3d91
        );
        background-size: 300% 300%;
        animation: oceanWave 8s ease-in-out infinite;
    }

    /* Camada extra de "ondas" translúcidas por cima, pra dar profundidade */
    #candEfetivos::before, #candNaoEfetivos::before {
        content: '';
        position: absolute;
        inset: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(
            circle at 30% 50%,
            rgba(255, 255, 255, 0.12) 0%,
            transparent 55%
        ),
        radial-gradient(
            circle at 70% 50%,
            rgba(255, 255, 255, 0.08) 0%,
            transparent 55%
        );
        animation: oceanDrift 12s linear infinite;
        pointer-events: none;
    }

    /* Garante que o texto/conteúdo fica por cima das camadas animadas */
    #candEfetivos > *, #candNaoEfetivos > * {
        position: relative;
        z-index: 1;
    }

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

    @keyframes oceanDrift {
        0% {
            transform: translate(0, 0) rotate(0deg);
        }
        50% {
            transform: translate(5%, 5%) rotate(180deg);
        }
        100% {
            transform: translate(0, 0) rotate(360deg);
        }
    }

    /* Modo escuro — paleta azul mais profunda/noturna, mesma animação */
    .dark-mode #candEfetivos, .dark-mode #candNaoEfetivos {
        background: linear-gradient(
            120deg,
            #041a3d,
            #0d3a70,
            #1a5ea3,
            #0d3a70,
            #041a3d
        );
        background-size: 300% 300%;
        animation: oceanWave 8s ease-in-out infinite;
    }

    /* Ícones da sidebar sempre brancos, independente do tema */
    .sideNavBar i,
    .sideNavBar .chevron,
    .sideNavBar .sideMenuItem.open .chevron,
    .sideNavBar .sidebarCollapseBtn i, .itemName, .subMenu {
        color: #ffffff !important;
    }

    /* Texto e ícone ficam pretos ao passar o mouse */
    .sideNavBar .sideMenuItemHeader:hover .itemName,
    .sideNavBar .sideMenuItem:not(.hasSubMenu):hover .itemName,
    .sideNavBar .subMenuItem:hover, .sidebarCollapseBtn:hover, .itemName:hover {
        color: #000000 !important;
    }

    .sideNavBar .sideMenuItemHeader:hover i,
    .sideNavBar .sideMenuItemHeader:hover .chevron,
    .sideNavBar .sideMenuItem:not(.hasSubMenu):hover i, .sidebarCollapseBtn:hover, .itemName:hover {
        color: #000000 !important;
    }


    /* =========================================================================
    NOVA PALETA — substitui o bloco :root e o bloco body.dark-mode
    no topo do style.css do dashboard "UAN ESTATÍSTICAS".
    Como quase todo o ficheiro usa var(--...), ao trocar estes dois blocos
    a nova paleta propaga-se automaticamente para sidebar, cards, gráficos,
    tabelas, botões, etc. Só ficam de fora algumas cores fixas (hexadecimais
    escritas diretamente numa regra) — essas estão listadas na segunda
    parte deste ficheiro, para colares no final do style.css.
    ========================================================================= */

    :root {
        /* Cores de marca (referência) */
        --primary: #003366;
        --primary-light: #004080;
        --accent: #fdc800;
        --accent-hover: #e6b800;
        --text-dark: #1a1a2e;
        --text-muted: #6c757d;
        --light-bg: #f8f9fa;
        --card-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
        --card-shadow-hover: 0 12px 40px rgba(0, 51, 102, 0.15);

        /* Variáveis existentes, remapeadas para a nova paleta */
        --bg-main: var(--light-bg);
        --bg-card: #ffffff;
        --bg-card-alt: #eef3f8;
        --text-color: rgba(26, 26, 46, 0.76);
        --text-color-strong: rgba(26, 26, 46, 0.92);
        --border-accent: var(--primary);
        --border-light: rgba(0, 51, 102, 0.08);
        --border-medium: rgba(0, 51, 102, 0.14);
        --shadow-color: rgba(0, 51, 102, 0.08);
        --shadow-color-strong: rgba(0, 51, 102, 0.15);
        --active-bg: rgba(0, 51, 102, 0.08);
        --grey-muted: var(--text-muted);
        --user-avatar-bg: #d6dee8;
        --bar-strong: var(--primary);
        --bar-medium: var(--primary-light);
        --bar-light: rgba(0, 51, 102, 0.32);
        --welcome-overlay: rgba(0, 20, 40, 0.85);
        --sidebar-width: 250px;
        --sidebar-width-collapsed: 84px;

        /* Cores por área de formação */
        --color-exatas: var(--primary);
        --color-sociais: var(--accent);
        --color-saude: #2E9E5C;

        /* Gráfico de Gênero */
        --genero-masc: var(--primary);
        --genero-fem: var(--accent-hover);

        /* Gráfico de Regime */
        --regime-diurno: var(--primary);
        --regime-noturno: var(--text-muted);
    }

    body.dark-mode {
        --primary: #4d84c4;
        --primary-light: #5f96d6;
        --accent: #fdc800;
        --accent-hover: #ffd633;
        --text-dark: #EAEAEA;
        --text-muted: #9aa5b1;
        --light-bg: #0d1b2a;
        --card-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
        --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.5);

        --bg-main: var(--light-bg);
        --bg-card: #12233a;
        --bg-card-alt: #1a2f4a;
        --text-color: #EAEAEA;
        --text-color-strong: #FFFFFF;
        --border-accent: var(--accent);
        --border-light: rgba(255, 255, 255, 0.089);
        --border-medium: rgba(255, 255, 255, 0.137);
        --shadow-color: rgba(0, 0, 0, 0.4);
        --shadow-color-strong: rgba(0, 0, 0, 0.5);
        --active-bg: rgba(253, 200, 0, 0.12);
        --grey-muted: var(--text-muted);
        --user-avatar-bg: #24405e;
        --bar-strong: var(--accent);
        --bar-medium: var(--accent-hover);
        --bar-light: rgba(253, 200, 0, 0.35);
        --welcome-overlay: rgba(5, 15, 25, 0.92);

        --color-exatas: var(--primary);
        --color-sociais: var(--accent);
        --color-saude: #48C97A;

        --genero-masc: var(--primary);
        --genero-fem: var(--accent);

        --regime-diurno: var(--primary);
        --regime-noturno: var(--text-muted);
    }

    /* =========================================================================
    PARTE 2 — cores fixas (fora de variáveis) para colar no FINAL do
    style.css. Estas regras têm de vir depois das originais para vencer
    por ordem no CSS (mesma especificidade).
    ========================================================================= */

    /* Botão "Gráficos": preto fixo → azul da marca */
    .graficosBtn {
        background: var(--primary) !important;
    }
    .graficosBtn i {
        color: #fff !important;
    }

    /* Botão do modal genérico (.modal-btn) */
    .modal-btn {
        background: var(--primary);
    }
    .modal-btn:hover {
        background: var(--primary-light);
    }

    /* Toggle de gráficos no modal */
    .chartToggleBtn.active {
        background: var(--primary);
        border-color: var(--primary);
    }

    /* Pins do mapa SVG de províncias */
    .tooltipsMaps {
        fill: var(--accent);
    }
    .tooltipsMaps:hover {
        fill: var(--primary);
    }

    /* Ranking — 1º lugar passa a usar o dourado da marca em vez de "gold" genérico */
    .rankingItem.top1 {
        background: rgba(253, 200, 0, 0.15);
    }
    .rankingItem.top1 .rankPos {
        color: var(--accent-hover);
    }
    body.dark-mode .rankingItem.top1 {
        background: rgba(253, 200, 0, 0.12);
    }

    /* Cabeçalho/rodapé da tabela de candidatos em modo escuro */
    body.dark-mode .candTable thead th {
        background: #17324d;
    }
    body.dark-mode .candTable tfoot tr {
        background: #0f2136;
    }

    .navVersion, .navSectionLabel{
        color:white;
    }


    /*ANIMAÇÕES NA DASHBOARD*/
    .distributionBarFill {
        transition: width 0.1s linear;
    }

    .activityRow {
        will-change: transform;
    }

    /* Uniformiza o botão de menu (mobile) e o botão de tema */
    #menuToggleBtn,
    #themeToggle {
        width: 50px;
        height: 44px;
        min-width: 50px;
    }

    /* Faz os links do dropdown "Ver Candidatos" ocuparem a linha toda */
    .periodDropdownMenu a.periodDropdownItem {
        display: block;
    }


    

    

    @media (max-width: 768px) {
        .section2-rightside > .leftCardElement:last-child {
            flex: 1 1 auto;   /* deixa de forçar basis 0 */
            min-height: 320px; /* garante espaço mínimo visível */
        }

        .activityList {
            flex: 1 1 auto;
            min-height: 200px;
            max-height: 420px; /* opcional: evita que fique gigante */
            overflow-y: auto;
        }
    }



    .candTable .uoLink {
    color: inherit;
    text-decoration: none;
}
.candTable .uoLink:hover {
    color: var(--primary);
    text-decoration: underline;
}

.candidatosGeralPage .section2 {
    flex: none;
    min-height: auto;
}

/* ===== ≤ 500px de largura: barra superior só com menu, modo escuro e mapa ===== */
@media (max-width: 500px) {
    #verCandidatosDropdown,
    #verResultadosDropdown {
        display: none;
    }

    .userInfoSection {
        gap: 8px;
    }
}