:root {
    /* ── 1. TOKENS PRIMITIVOS DE MARCA E PALETA CROMÁTICA V1 ── */
    /* Brand Vinho Oficial MPRJ / DIPRO */
    --dipro-brand-wine-pure: #6B3439;    /* Vinho Institucional Principal (#6B3439 - rgb: 107, 52, 57) */
    --dipro-brand-wine-dark: #4E2529;    /* Vinho Hover / Escuro Oficial (#4E2529) */
    --dipro-brand-wine-light: #B85C63;   /* Vinho Acessível / Dark Mode (WCAG AA pass) */
    --dipro-brand-wine-soft: #A15C55;    /* Vinho Suave Intermediário */
    --dipro-brand-wine-subtle: #F5EAEC;  /* Vinho Tint Claro 5-10% */

    /* Escala Centralizada de Transparências (Alpha Tokens) - Default / Light */
    --brand-alpha-05: rgba(107, 52, 57, 0.05); /* Hover ultra-sutil / fundos leves */
    --brand-alpha-10: rgba(107, 52, 57, 0.10); /* Fundos de tags, abas, filtros e itens ativos */
    --brand-alpha-25: rgba(107, 52, 57, 0.25); /* Bordas ativas, foco e outlines secundários */
    --brand-alpha-50: rgba(107, 52, 57, 0.50); /* Sombras médias e divisórias de destaque */
    --brand-alpha-100: #6B3439;                /* Cor sólida cheia */

    /* Aliases Primitivos Legados (Preservação de compatibilidade total) */
    --primitives-wine-800: var(--dipro-brand-wine-pure);
    --primitives-wine-900: var(--dipro-brand-wine-dark);
    --primitives-wine-700: #8B3D43;
    --primitives-wine-300: #E37C82;

    /* Solarized Dark Palette */
    --primitives-solarized-base: #002B36;
    /* Fundo Base Dark */
    --primitives-solarized-surface: #073642;
    /* Superfície Card/Modal */
    --primitives-solarized-elevated: #094352;
    /* Elevado */
    --primitives-solarized-hover: #0D4E5E;
    /* Hover de Linha */

    /* Solarized Text Palette (Luminância Calibrada para WCAG 2.1 AA/AAA) */
    --primitives-solarized-cream: #FDF6E3;
    /* High Emphasis - 10.5:1 */
    --primitives-solarized-light: #B6C5C7;
    /* Body Text - 6.7:1 (AA Pass) */
    --primitives-solarized-muted: #B6C5C7;
    /* Muted Text - 6.7:1 (AA Pass) */
    --primitives-solarized-secondary: #B6C5C7;

    /* Neutral Light Palette (Slate/Gray Modern Spec) */
    --primitives-paper-base: #fbf8f5;
    /* Base BG Light */
    --primitives-stone-surface: #F0F2F5;
    /* Elevated Surface Light */
    --primitives-stone-border: #DFE3E8;
    /* Border Light */
    --primitives-ink-strong: #101828;
    /* Text Primary */
    --primitives-ink-body: #475467;
    /* Text Secondary */
    --primitives-ink-muted: #98A2B3;
    /* Text Muted */

    /* Semânticas Primitivas */
    --primitives-success: #859900;
    --primitives-warning: #B58900;
    --primitives-info: #268BD2;
    --primitives-danger: #DC3545;

    /* Typographic Fonts & Scales */
    --font-sans: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Fraunces', Georgia, serif;
    --font-mono: 'IBM Plex Mono', Consolas, monospace;

    --font-family: var(--font-sans);
    --sans: var(--font-sans);
    --serif: var(--font-serif);
    --mono: var(--font-mono);

    --font-display: 4.0rem;
    --font-h1: 3.2rem;
    --font-h2: 2.4rem;
    --font-h3: 1.8rem;
    --font-h4: 1.6rem;
    --font-body: 1.5rem;
    --font-sm: 1.3rem;
    --font-xs: 1.2rem;

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;

    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;

    --tracking-tight: -0.02em;
    --tracking-normal: 0em;
    --tracking-wide: 0.05em;
    --tracking-wider: 0.08em;

    /* Spacing & Layout */
    --space-xs: 0.375rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 1.75rem;
    --space-xl: 2.5rem;
    --space-2xl: 3.5rem;
    --space-section: 2.5rem;

    --container-max: 1200px;
    --container-wide: 1400px;
    --container-padding: 1.5rem;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    /* Motion */
    --ease-stripe-default: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-stripe-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-stripe-sharp: cubic-bezier(0.4, 0, 0.2, 1);

    --duration-fast: 120ms;
    --duration-medium: 250ms;
    --duration-slow: 400ms;

    --spacing-xs: var(--space-xs);
    --spacing-sm: var(--space-sm);
    --spacing-md: var(--space-md);
    --spacing-lg: var(--space-lg);
    --spacing-xl: var(--space-xl);
    --touch-target: 44px;
}

/* ── 2. TOKENS SEMÂNTICOS DEFAULT / DARK MODE (SOLARIZED CYAN + WINE) ── */
:root,
html[data-theme="dark"] {
    --ink: #101828;
    --paper: #fbf8f5;
    --stone: #F0F2F5;
    --wine: var(--dipro-brand-wine-light);
    --wine-dark: var(--dipro-brand-wine-dark);
    --wine-soft: var(--dipro-brand-wine-light);

    /* Escala Centralizada de Transparências (Alpha Tokens) - Dark Mode */
    --brand-alpha-05: rgba(184, 92, 99, 0.08);
    --brand-alpha-10: rgba(184, 92, 99, 0.16);
    --brand-alpha-25: rgba(184, 92, 99, 0.35);
    --brand-alpha-50: rgba(184, 92, 99, 0.60);
    --brand-alpha-100: var(--dipro-brand-wine-light);

    /* Base Surfaces & Backgrounds */
    --color-bg: #002B36;
    --color-bg-base: #002B36;
    --color-bg-surface: #073642;
    --color-bg-elevated: #0D4E5E;
    --color-bg-subtle: #05232C;
    --color-bg-hover: #0D4E5E;
    --color-white: #FFFFFF;

    --color-surface: #073642;
    --color-surface-subtle: #05232C;
    --color-surface-hover: #0D4E5E;

    /* Card Destacado (Fill-Brand Sólido Dark) */
    --color-surface-brand: #4E2529;
    --color-text-on-brand: var(--primitives-solarized-cream);
    --color-text-on-brand-hi: #FFFFFF;

    /* Glassmorphism Tokens (Dark) */
    --color-glass-bg: rgba(7, 54, 66, 0.85);
    --color-glass-border: rgba(184, 92, 99, 0.25);
    --glass-blur: blur(14px);

    /* Typography (Calibração WCAG 2.1 AA/AAA) */
    --color-text-strong: #FDF6E3;
    --color-text-primary: #FDF6E3;
    --color-text: #FDF6E3;
    --color-text-body: #FDF6E3;
    --color-text-secondary: #B6C5C7;
    --color-text-muted: #B6C5C7;
    --color-text-subtle: #B6C5C7;
    --color-text-light: #B6C5C7;
    --color-text-on-primary: #FFFFFF;

    /* Borders & Non-Text UI Contrast (WCAG 1.4.11 ≥ 3:1) */
    --color-border-subtle: rgba(182, 197, 199, 0.15);
    --color-border-default: rgba(182, 197, 199, 0.25);
    --color-border-strong: rgba(182, 197, 199, 0.45);
    --color-border: rgba(182, 197, 199, 0.25);
    --color-border-light: rgba(182, 197, 199, 0.20);
    --color-border-focus: #B85C63;

    /* Interactive Primary (Wine - Dark Mode calibrado para acessibilidade WCAG) */
    --color-primary: #B85C63;
    --color-primary-hover: #C46E75;
    --color-primary-subtle: var(--brand-alpha-10);
    --color-primary-border: var(--brand-alpha-25);
    --color-primary-glow: var(--brand-alpha-25);

    /* Functional Status */
    --color-success: #859900;
    --color-warning: #B58900;
    --color-info: #268BD2;
    --color-danger: #DC3545;

    --color-status-success-bg: rgba(133, 153, 0, 0.2);
    --color-status-success-tx: #B8CC33;
    --color-status-warning-bg: rgba(181, 137, 0, 0.2);
    --color-status-warning-tx: #E5B833;
    --color-status-danger-bg: rgba(220, 53, 69, 0.2);
    --color-status-danger-tx: #F87171;
    --color-status-info-bg: rgba(38, 139, 210, 0.2);
    --color-status-info-tx: #58B2DC;

    /* Shadows & Modals */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.75);
    --shadow-hover: 0 0 0 1px var(--color-border-focus), 0 8px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(184, 92, 99, 0.3);

    --header-bg: #412125;
    --header-color: #FFFFFF;
    --footer-bg: #412125;
    --footer-color: #fbf8f5;
    --nav-link-color: rgba(255, 255, 255, 0.85);
    --nav-link-hover: #FFFFFF;
    --nav-link-active: #B85C63;
    --nav-backdrop-bg: rgba(255, 255, 255, 0.12);
    --nav-backdrop-border: rgba(255, 255, 255, 0.2);
    --nav-icon-fill: #B85C63;

    --kbd-bg: rgba(147, 66, 74, 0.2);
    --kbd-border: rgba(184, 92, 99, 0.3);
    --kbd-text: #F1E6D6;

    --modal-bg: #073642;
    --modal-border: rgba(182, 197, 199, 0.25);
    --modal-overlay-bg: rgba(0, 43, 54, 0.85);

    --scrollbar-thumb: rgba(182, 197, 199, 0.3);
    --scrollbar-thumb-hover: rgba(184, 92, 99, 0.5);
}

/* ── 3. TOKENS SEMÂNTICOS: LIGHT MODE (MODERN NEUTRAL SLATE/GRAY + WINE) ── */
html[data-theme="light"] {
    --ink: #101828;
    --ink-soft: #475467;
    --paper: #fbf8f5;
    --stone: #F0F2F5;
    --stone-line: #DFE3E8;
    --wine: var(--dipro-brand-wine-pure);
    --wine-dark: var(--dipro-brand-wine-dark);
    --wine-soft: var(--dipro-brand-wine-soft);
    --white: #FFFFFF;

    /* Escala Centralizada de Transparências (Alpha Tokens) - Light Mode */
    --brand-alpha-05: rgba(107, 52, 57, 0.05);
    --brand-alpha-10: rgba(107, 52, 57, 0.10);
    --brand-alpha-25: rgba(107, 52, 57, 0.25);
    --brand-alpha-50: rgba(107, 52, 57, 0.50);
    --brand-alpha-100: var(--dipro-brand-wine-pure);

    /* Base Surfaces & Backgrounds */
    --color-bg: #fbf8f5;
    --color-bg-base: #fbf8f5;
    --color-bg-surface: #FFFFFF;
    --color-bg-elevated: #F0F2F5;
    --color-bg-subtle: #F4F5F7;
    --color-bg-hover: #E9EBEE;
    --color-white: #FFFFFF;

    --color-surface: #FFFFFF;
    --color-surface-subtle: #F4F5F7;
    --color-surface-hover: #E9EBEE;

    /* Card Destacado (Fill-Brand Sólido Light) */
    --color-surface-brand: var(--dipro-brand-wine-pure);
    --color-text-on-brand: #fbf8f5;
    --color-text-on-brand-hi: #FFFFFF;

    /* Glassmorphism Tokens (Light) */
    --color-glass-bg: rgba(255, 255, 255, 0.85);
    --color-glass-border: var(--brand-alpha-25);
    --glass-blur: blur(14px);

    /* Typography (Clean Modern Contrast) */
    --color-text-strong: #101828;
    --color-text-primary: #101828;
    --color-text: #101828;
    --color-text-body: #101828;
    --color-text-secondary: #475467;
    --color-text-muted: #98A2B3;
    --color-text-subtle: #98A2B3;
    --color-text-light: #98A2B3;
    --color-text-on-primary: #FFFFFF;

    /* Borders & Non-Text UI Contrast */
    --color-border-subtle: #EAECEF;
    --color-border-default: #DFE3E8;
    --color-border-strong: #C1C7D0;
    --color-border: #DFE3E8;
    --color-border-light: #EAECEF;
    --color-border-focus: var(--dipro-brand-wine-pure);

    /* Interactive Primary (Wine) */
    --color-primary: var(--dipro-brand-wine-pure);
    --color-primary-hover: var(--dipro-brand-wine-dark);
    --color-primary-subtle: var(--brand-alpha-10);
    --color-primary-border: var(--brand-alpha-25);
    --color-primary-glow: var(--brand-alpha-25);

    /* Functional Status */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-info: #3B82F6;
    --color-danger: #EF4444;

    --color-status-success-bg: #ECFDF5;
    --color-status-success-tx: #047857;
    --color-status-warning-bg: #FFFBEB;
    --color-status-warning-tx: #B45309;
    --color-status-danger-bg: #FEF2F2;
    --color-status-danger-tx: #B91C1C;
    --color-status-info-bg: #EFF6FF;
    --color-status-info-tx: #1D4ED8;

    /* Shadows & Modals */
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
    --shadow-hover: 0 0 0 1px var(--color-border-focus), 0 8px 24px var(--brand-alpha-10);
    --shadow-glow: 0 0 20px var(--brand-alpha-25);

    --header-bg: #6B3439;
    --header-color: #FFFFFF;
    --footer-bg: #6B3439;
    --footer-color: #fbf8f5;
    --nav-link-color: rgba(255, 255, 255, 0.85);
    --nav-link-hover: #FFFFFF;
    --nav-link-active: #B85C63;
    --nav-backdrop-bg: rgba(255, 255, 255, 0.12);
    --nav-backdrop-border: rgba(255, 255, 255, 0.2);
    --nav-icon-fill: #B85C63;

    --kbd-bg: var(--brand-alpha-10);
    --kbd-border: var(--brand-alpha-25);
    --kbd-text: var(--dipro-brand-wine-pure);

    --modal-bg: rgba(255, 255, 255, 0.98);
    --modal-border: #DFE3E8;
    --modal-overlay-bg: rgba(16, 24, 40, 0.45);

    --scrollbar-thumb: rgba(152, 162, 179, 0.4);
    --scrollbar-thumb-hover: var(--brand-alpha-50);
}

/* ── 4. CAMADA LEVE DE UTILITÁRIOS CROMÁTICOS E TIPOGRÁFICOS ── */
.text-primary {
    color: var(--color-text-primary) !important;
}

.text-secondary {
    color: var(--color-text-secondary) !important;
}

.text-muted {
    color: var(--color-text-muted) !important;
}

.text-brand {
    color: var(--color-primary) !important;
}

.text-on-brand {
    color: var(--color-text-on-brand) !important;
}

.bg-base {
    background-color: var(--color-bg-base) !important;
}

.bg-surface {
    background-color: var(--color-bg-surface) !important;
}

.bg-elevated {
    background-color: var(--color-bg-elevated) !important;
}

.bg-subtle {
    background-color: var(--color-bg-subtle) !important;
}

.bg-brand {
    background-color: var(--color-surface-brand) !important;
}

.bg-glass {
    background: var(--color-glass-bg) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.border-default {
    border-color: var(--color-border-default) !important;
}

.border-strong {
    border-color: var(--color-border-strong) !important;
}

.border-glass {
    border-color: var(--color-glass-border) !important;
}

html {
    height: 100%;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

footer,
.footer {
    margin-top: auto;
    flex-shrink: 0;
}

html[data-contrast="high"] {
    --color-bg: #0B0B0C !important;
    --color-text: #FFFFFF !important;
    --color-text-strong: #FFFFFF !important;
    --color-primary: #4DA3FF !important;
    --color-border: #E5E7EB !important;
    --color-surface: #121214 !important;
}

html[data-contrast="high"] body,
html[data-contrast="high"] .main-content,
html[data-contrast="high"] .dashboard-container,
html[data-contrast="high"] .home-hero-card {
    background-color: #0B0B0C !important;
    color: #FFFFFF !important;
}

html[data-contrast="high"] .card,
html[data-contrast="high"] .project-card,
html[data-contrast="high"] .sidebar,
html[data-contrast="high"] .container,
html[data-contrast="high"] .panel,
html[data-contrast="high"] .modal,
html[data-contrast="high"] .display-settings-popover {
    background-color: #121214 !important;
    border: 1px solid #E5E7EB !important;
    color: #FFFFFF !important;
}

html[data-color-mode="colorblind"] {
    --color-primary: #005FCC !important;
    --color-success: #0077B6 !important;
    --color-danger: #6A4C93 !important;
}

html[data-color-mode="colorblind"] .status-error,
html[data-color-mode="colorblind"] .badge-danger,
html[data-color-mode="colorblind"] .alert-danger {
    border-left: 4px solid var(--color-danger) !important;
    position: relative;
}

html {
    font-size: 62.5%;
    scrollbar-gutter: stable;
}

html[data-scale="1"] {
    font-size: 62.5%;
}

html[data-scale="1.1"] {
    font-size: 68.75%;
}

html[data-scale="1.2"] {
    font-size: 75%;
}

html[data-scale="1.3"] {
    font-size: 81.25%;
}

html[data-scale="1.4"] {
    font-size: 87.5%;
}

/* ── Controles de UI de Acessibilidade ── */
.a11y-controls-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 2px 4px;
    margin-right: 6px;
}

.a11y-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--sans);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
}

.a11y-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.a11y-btn:focus-visible {
    outline: 2px solid #4DA3FF;
    outline-offset: 1px;
}

.a11y-btn.is-active {
    background: var(--nav-link-active, #B85C63);
    color: #FFFFFF;
}

/* ── Botão de Alternância de Tema (Light / Dark) ── */
.theme-toggle-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
    padding: 0 !important;
    border-radius: 0 !important;
    cursor: pointer;
    transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 4px;
}

.theme-toggle-btn:hover {
    background: transparent !important;
    opacity: 0.8;
    transform: scale(1.1);
}

.theme-toggle-btn svg {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

html[data-theme="dark"] .theme-toggle-btn .icon-moon {
    display: none !important;
}

html[data-theme="dark"] .theme-toggle-btn .icon-sun {
    display: block !important;
    color: #FFD700 !important;
    stroke: #FFD700 !important;
}

html[data-theme="light"] .theme-toggle-btn .icon-sun {
    display: none !important;
}

html[data-theme="light"] .theme-toggle-btn .icon-moon {
    display: block !important;
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

/* ── Popover Regulador de Zoom (Slider com 4 Bolinhas) ── */
.zoom-toggle-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

html[data-theme="light"] .zoom-toggle-btn {
    background: transparent !important;
    border: none !important;
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

.zoom-toggle-btn svg {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

.zoom-toggle-btn:hover,
.zoom-toggle-btn.is-active {
    background: transparent !important;
    border: none !important;
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
    opacity: 0.85;
    transform: scale(1.1);
}

.zoom-popover-panel {
    position: absolute;
    top: 125%;
    right: 0;
    width: 250px;
    background: var(--color-surface, #FFFFFF);
    border: 1px solid var(--color-border, #D6D3D1);
    border-radius: var(--radius-lg, 10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

html[data-theme="dark"] .zoom-popover-panel {
    background: var(--color-surface, #073642);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.zoom-popover-panel[hidden] {
    display: none !important;
}

.zoom-popover-header {
    padding: 8px 12px;
    background: var(--color-surface-subtle, rgba(0, 0, 0, 0.05));
    border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-strong, #2B2B2B);
    text-align: center;
}

html[data-theme="dark"] .zoom-popover-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.zoom-popover-body {
    padding: 14px 12px;
}

.zoom-slider-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.zoom-stepper-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-surface-subtle, #F3F4F6);
    border: 1px solid var(--color-border, #D1D5DB);
    color: var(--color-text-strong, #1F2937);
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
    user-select: none;
}

html[data-theme="dark"] .zoom-stepper-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.zoom-stepper-btn:hover {
    background: #93424A;
    border-color: #6B3439;
    color: #FFFFFF !important;
}

/* A LINHA DO TRILHO - Tom Vinho da Paleta DIPRO */
.zoom-track-line {
    flex: 1;
    position: relative;
    height: 4px;
    background: #93424A;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 4px;
}

html[data-theme="dark"] .zoom-track-line {
    background: #B85C63;
}

.zoom-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #93424A;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
    box-sizing: border-box;
}

html[data-theme="dark"] .zoom-dot {
    background: #073642;
    border-color: #B85C63;
}

.zoom-dot:hover {
    transform: scale(1.2);
    border-color: #6B3439;
}

.zoom-dot.is-active {
    background: #93424A !important;
    border-color: #FFFFFF !important;
    box-shadow: 0 0 8px rgba(147, 66, 74, 0.6);
    transform: scale(1.3);
}

html[data-theme="dark"] .zoom-dot.is-active {
    background: #B85C63 !important;
    border-color: #FFFFFF !important;
    box-shadow: 0 0 8px rgba(184, 92, 99, 0.8);
}

[data-accessibility="high-contrast"] .a11y-controls-group {
    background: #000000;
    border: 2px solid #FFFFFF;
}

[data-accessibility="high-contrast"] .a11y-btn {
    color: #FFFFFF;
}

[data-accessibility="high-contrast"] .a11y-btn.is-active {
    background: #4DA3FF;
    color: #000000;
    font-weight: 800;
}

/* ── Central de Notificações Globais ── */
.notifications-wrapper {
    position: relative;
    display: inline-block;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #E53E3E;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid var(--header-bg);
}

.notifications-dropdown {
    position: absolute;
    top: 125%;
    right: 0;
    width: 320px;
    background: var(--color-surface, #073642);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.2));
    border-radius: var(--radius-lg, 10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    color: var(--color-text-body, #839496);
}

.notifications-dropdown.is-open {
    display: flex;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-strong, #FFFFFF);
}

.notif-read-all {
    background: transparent;
    border: none;
    color: var(--color-primary-hover, #4DA3FF);
    font-size: 1.1rem;
    cursor: pointer;
}

.notif-body {
    max-height: 300px;
    overflow-y: auto;
}

.notif-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border-light, rgba(255, 255, 255, 0.06));
    text-decoration: none !important;
    transition: background 0.15s ease;
}

.notif-item:hover {
    background: var(--color-surface-hover, rgba(255, 255, 255, 0.05));
}

.notif-item.is-unread {
    border-left: 3px solid #4DA3FF;
    background: rgba(77, 163, 255, 0.05);
}

.notif-item-tag {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #4DA3FF;
    margin-bottom: 2px;
}

.notif-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-strong, #FFFFFF);
    margin-bottom: 4px;
    line-height: 1.3;
}

.notif-item-desc {
    font-size: 1.1rem;
    color: var(--color-text-muted, #999);
    line-height: 1.3;
}

.notif-footer {
    padding: 8px 14px;
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
}

.notif-footer a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-hover, #4DA3FF);
    text-decoration: none;
}

/* ── Global Scrollbar (Command Center) ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

::selection {
    background: rgba(126, 60, 58, 0.35);
    color: #fff;
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--color-text-body);
    font-size: var(--font-body);
    line-height: var(--leading-relaxed);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* código do cabeçalho */

.header {
    position: sticky !important;
    top: 0;
    z-index: 9999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.75);
}

html[data-theme="dark"] .header {
    background: rgba(7, 54, 66, 0.75);
}

html[data-contrast="high"] .header {
    background: rgba(11, 11, 12, 0.95) !important;
    border-bottom: 1px solid #E5E7EB !important;
}

.nav-container {
    max-width: 90%;
    /* Largura máxima do conteúdo */
    height: 80px;
    margin: 0 auto;
    /* Centraliza o container horizontalmente */
    display: flex;
    /* Habilita Flexbox */
    justify-content: space-between;
    /* Empurra os filhos para as extremidades */
    align-items: center;
    /* Alinha os itens verticalmente ao centro */
    flex-wrap: nowrap;
    width: 100%;
}

.nav-logo {
    display: flex;
    /* Ensures the link wrapper behaves correctly */
    align-items: center;
    /* A logo atua como a "coluna" da esquerda */
}

.nav-logo svg,
.header-logo {
    height: 50px;
    width: 160px;
    object-fit: contain;
}

.nav-collapsible {
    display: flex;
    align-items: center;
    flex-grow: 1;
    /* Permite que este container ocupe o espaço restante */
    justify-content: center;
    /* Centraliza os links de navegação */
    /* Este container agora atua como a "coluna" central */
}

.nav-links {
    display: flex;
    gap: 24px;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0 auto;
    position: relative;
}

/* Stripe Floating Backdrop Container */
.stripe-nav-backdrop {
    display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    background: var(--nav-backdrop-bg);
    border: 1px solid var(--nav-backdrop-border);
    border-radius: var(--radius-sm);
    pointer-events: none;
    opacity: 0;
    transform: translate3d(0, 0, 0);
    transition:
        transform 300ms var(--ease-stripe-default),
        width 300ms var(--ease-stripe-default),
        height 300ms var(--ease-stripe-default),
        opacity 200ms ease;
    z-index: 0;
}

.nav-links a,
.nav-links .dropdown {
    position: relative;
    z-index: 1;
}

/* Ajustes responsivos para telas intermediárias de desktop */
@media (max-width: 1400px) {
    .nav-links {
        gap: 20px;
    }
}

@media (max-width: 1200px) {
    .nav-links {
        gap: 16px;
    }
}

/* NOVO: Grupo de ícones/links do usuário */
.nav-user-group {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-left: auto;
}

.nav-user-group a {
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-user-group a svg {
    fill: #FFFFFF;
    color: #FFFFFF;
}

/* ── Nova Animação Premium para Ícones no Hover ── */
.nav-user-group a svg,
.theme-toggle-btn svg,
.nav-icons a svg {
    transition: transform 300ms var(--ease-stripe-bounce), filter 300ms ease, color 200ms ease;
    will-change: transform, filter;
}

.nav-user-group a:hover svg,
.theme-toggle-btn:hover svg,
.nav-icons a:hover svg {
    transform: translateY(-3px) scale(1.18) rotate(-6deg);
    filter: drop-shadow(0 4px 10px rgba(184, 92, 99, 0.5));
}

.nav-links a {
    color: var(--nav-link-color);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-sm);
    letter-spacing: 0.01em;
    transition: color var(--duration-fast) ease;
    padding: 6px 0;
}

.nav-links a:hover {
    color: var(--nav-link-hover);
}

/* Mensagem de saudação ao usuário */
.nav-user-greeting {
    color: var(--color-text-muted);
    font-size: var(--font-sm);
}

.nav-links a.active-nav {
    font-weight: normal;
    color: var(--nav-link-active);
}

/* ── Theme Toggle Button ── */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-medium) var(--ease-stripe-default);
    position: relative;
    padding: 0;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    stroke: #FFFFFF !important;
    transition: transform var(--duration-slow) var(--ease-stripe-bounce), opacity var(--duration-fast) ease;
}

.theme-toggle-btn:hover svg {
    transform: rotate(20deg);
}

html[data-theme="light"] .theme-toggle-btn .icon-sun {
    display: none;
}

html[data-theme="light"] .theme-toggle-btn .icon-moon {
    display: block;
    stroke: #FFFFFF !important;
}

html[data-theme="dark"] .theme-toggle-btn .icon-sun,
:root:not([data-theme="light"]) .theme-toggle-btn .icon-sun {
    display: block;
    stroke: #FFFFFF !important;
}

html[data-theme="dark"] .theme-toggle-btn .icon-moon,
:root:not([data-theme="light"]) .theme-toggle-btn .icon-moon {
    display: none;
}

/* ── BLOBS AMBIENTAIS DO MOCKUP ── */
.blobs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.04;
}

.b1 {
    width: 600px;
    height: 600px;
    background: #6B3439;
    top: -100px;
    right: -80px;
}

.b2 {
    width: 380px;
    height: 380px;
    background: #4A2326;
    bottom: -60px;
    left: -60px;
}

.b3 {
    display: none;
}

/* ── MOCKUP GLASS COMPONENTES ── */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    position: relative;
    z-index: 2;
}

.glass-sm {
    border-radius: 10px;
}

/* ── MOCKUP HEADER & LOGO DIPRO SEA ── */
.logo-mockup {
    color: var(--color-text-strong);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.1;
    display: inline-block;
}

.logo-mockup span {
    display: block;
}

.logo-line {
    width: 36px;
    height: 1px;
    background: var(--accent-light, #B85C63);
    margin: 2px 0;
}

/* ── SCREEN 1: HOME MOCKUP CLASSES ── */
.home-wrap {
    min-height: calc(100vh - 80px - 70px);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

.home-panel {
    width: 100%;
    max-width: 820px;
    padding: 22px 28px;
    box-sizing: border-box;
}

.home-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.avatar-wrap {
    position: relative;
}

.avatar {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    background: #FFFFFF !important;
    border: 2px solid var(--accent-light, #B85C63) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #6B3439 !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.avatar svg {
    width: 36px !important;
    height: 36px !important;
    stroke: #6B3439 !important;
    fill: none !important;
    background: transparent !important;
}

.online-dot {
    display: none !important;
}

.home-greeting {
    font-size: 3.3rem !important;
    height: auto !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    font-weight: 600 !important;
    color: var(--color-text-strong) !important;
}

.home-sub {
    display: none !important;
}

.badge-tag {
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 1.2rem !important;
    letter-spacing: .05em !important;
    background: transparent !important;
    border: none !important;
    color: var(--color-text-muted) !important;
    font-weight: 500 !important;
    display: inline-block;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Modo 1: Grid (4 colunas) */
.home-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    transition: all 0.2s ease;
    margin-top: 30px !important;
    margin-bottom: 15px !important;
}

@media (max-width: 768px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Modo 2: Lista / Compacto (2 colunas horizontais) */
.home-grid.compact {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}

@media (max-width: 600px) {
    .home-grid.compact {
        grid-template-columns: 1fr !important;
    }
}

.home-grid.compact .shortcut {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    padding: 10px 14px !important;
    gap: 12px !important;
}

.home-grid.compact .sc-icon {
    margin: 0 !important;
    min-width: 34px !important;
    flex-shrink: 0 !important;
}

.home-grid.compact .sc-label {
    font-size: 1.2rem !important;
    line-height: 1.3 !important;
}

.shortcut {
    padding: 12px 10px;
    border-radius: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.10));
    cursor: pointer;
    transition: all .18s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.shortcut:hover {
    background: rgba(147, 66, 74, 0.14);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.sc-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    margin: 0 auto 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent-light, #B85C63);
    fill: none;
    stroke-width: 1.5;
}

.voltar-btn {
    display: block;
    margin-left: 0;
    text-align: left;
}

.customize-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.customize-bar span {
    font-size: 1.1rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-toggle {
    display: flex;
    gap: 4px;
}

.mt-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.10));
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mt-btn.active {
    background: var(--color-surface-subtle, rgba(107, 52, 57, 0.15));
    border-color: var(--color-primary);
}

.mt-btn.active svg {
    stroke: var(--color-primary);
}

.mt-btn svg {
    width: 13px;
    height: 13px;
    stroke: var(--color-text-strong);
    fill: none;
    stroke-width: 1.5;
}

/* ── SCREEN 2: CRAAI MOCKUP CLASSES ── */
.craai-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 160px);
    position: relative;
    z-index: 2;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    padding: 20px 0;
    border-right: 1px solid var(--sidebar-border, rgba(147, 161, 161, 0.15));
    background: var(--sidebar-bg, rgba(7, 54, 66, 0.75));
    backdrop-filter: blur(12px);
    flex-shrink: 0;
    box-sizing: border-box;
}

.sidebar-title {
    font-size: 1.5rem;
    letter-spacing: .1em;
    color: var(--color-text-muted);
    padding: 0 16px 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-item {
    padding: 9px 16px;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all .15s ease;
    text-decoration: none;
    display: block;
}

.sidebar-item:not(.comarca-item):hover {
    color: var(--color-text-strong);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-item.active:not(.comarca-item) {
    color: var(--color-text-strong);
    font-weight: lighter;
}

.craai-main {
    flex: 1;
    min-width: 0;
    padding: 28px;
    overflow: auto;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: craai-content;
}

.page-title {
    font-family: var(--font-family);
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text-strong);
    text-align: left;
    margin-bottom: 6px;
    letter-spacing: -0.015em;
    line-height: 1.25;
    text-transform: none;
}

.page-sub {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-muted);
    text-align: left;
    letter-spacing: 0.01em;
    margin-bottom: 20px;
    text-transform: none;
    line-height: 1.5;
}

.search-bar {
    position: relative;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.10));
    color: var(--color-text-strong);
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--color-primary);
}

.view-btns {
    display: flex;
    gap: 4px;
}

.vb {
    padding: 7px 12px;
    border-radius: 6px;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.10));
    background: transparent;
    color: var(--color-text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.vb.active {
    background: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
    font-weight: 600;
}

.section-label {
    font-size: 2rem;
    letter-spacing: .08em;
    color: var(--accent-light, #B85C63);
    margin-top: 30px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    font-weight: 700;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.project-row {
    display: flex;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.10));
    margin-bottom: 14px;
    background: var(--glass-bg, rgba(7, 54, 66, 0.55));
    backdrop-filter: blur(18px);
    transition: all 0.2s ease;
}

.project-row:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-img {
    width: 130px;
    min-width: 130px;
    background: #073642;
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .8;
}

.project-img-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100px;
    background: linear-gradient(135deg, #073642 0%, #0a3344 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img-placeholder svg {
    width: 30px;
    height: 30px;
    stroke: rgba(255, 255, 255, 0.2);
    fill: none;
    stroke-width: 1;
}

.project-info {
    flex: 1;
    padding: 14px 18px;
}

.proj-type {
    font-size: 0.9rem;
    letter-spacing: .08em;
    color: var(--accent-light, #B85C63);
    margin-bottom: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.proj-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-strong);
    margin-bottom: 3px;
}

.proj-addr {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 6px;
}

.proj-desc {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.proj-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    background: rgba(38, 139, 210, 0.15);
    border: 1px solid rgba(38, 139, 210, 0.3);
    color: #268BD2;
    margin-top: 8px;
    font-weight: 600;
}

.proj-cta {
    display: flex;
    align-items: center;
    padding: 14px;
}

.btn-sm {
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--color-primary);
    color: #EEE8D5;
    border: none;
    cursor: pointer;
    letter-spacing: .04em;
    white-space: nowrap;
    transition: background 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sm:hover {
    background: var(--color-primary-hover);
}

/* ── SCREEN 3: GERENCIAR PROJETOS MOCKUP CLASSES ── */
.gp-layout {
    display: flex;
    min-height: calc(100vh - 120px);
    position: relative;
    z-index: 2;
}

.gp-sidebar {
    width: 220px;
    min-width: 220px;
    padding: 16px;
    border-right: 1px solid var(--sidebar-border, rgba(147, 161, 161, 0.15));
    background: var(--sidebar-bg, rgba(7, 54, 66, 0.75));
    backdrop-filter: blur(12px);
}

.gp-sidebar-title {
    font-size: 0.9rem;
    letter-spacing: .1em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    text-transform: uppercase;
}

.add-btn {
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--color-primary);
    color: #EEE8D5;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.add-btn:hover {
    background: var(--color-primary-hover);
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all .15s ease;
    color: var(--color-text);
    text-decoration: none;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-strong);
}

.tree-item.active {
    background: rgba(147, 66, 74, 0.18);
    color: #EEE8D5;
    font-weight: 600;
}

.tree-count {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.tree-chevron {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.tree-sub {
    padding-left: 16px;
}

.gp-main {
    flex: 1;
    padding: 24px 28px;
    overflow: auto;
}

.comarca-badge {
    background: #ffffff82;
    color: #555;
    font-size: 1.1rem;
    padding: 2px 8px;
    border-radius: 100%;
    font-weight: 500;
}

.comarca-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--color-text-strong);
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.prop-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.10));
    background: var(--glass-bg, rgba(7, 54, 66, 0.55));
    backdrop-filter: blur(18px);
    cursor: pointer;
    transition: all .18s ease;
    text-decoration: none;
    display: block;
}

.prop-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.prop-img {
    height: 115px;
    background: linear-gradient(135deg, #073642, #0c3a48);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.prop-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prop-img svg {
    width: 32px;
    height: 32px;
    stroke: rgba(255, 255, 255, 0.15);
    fill: none;
    stroke-width: 1;
}

.prop-body {
    padding: 12px 14px;
}

.prop-addr {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-strong);
    margin-bottom: 3px;
}

.prop-name {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 6px;
}

.prop-tipo {
    font-size: 0.9rem;
    color: var(--accent-light, #B85C63);
    letter-spacing: .05em;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.prop-projects {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.proj-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #268BD2;
}

/* TABS SCROLL */
.tabs-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--sidebar-border, rgba(147, 161, 161, 0.15));
    padding: 0 20px;
    background: var(--tabs-bg, rgba(7, 54, 66, 0.65));
    backdrop-filter: blur(12px);
    scrollbar-width: none;
    position: relative;
    z-index: 2;
}

.tabs-scroll::-webkit-scrollbar {
    display: none;
}

.tab-item {
    padding: 10px 18px;
    font-size: 1.1rem;
    color: var(--color-text);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    font-weight: 500;
}

.tab-item.active {
    color: var(--color-text-strong);
    border-bottom-color: var(--accent-light, #B85C63);
    font-weight: 600;
}

.tab-item:hover:not(.active) {
    color: var(--color-text-strong);
}

/* BREADCRUMB (Com formatação eyebrow de Saiba Mais e posição de gerenciar_projetos.php) */
.breadcrumb {
    font-family: 'IBM Plex Mono', var(--mono), monospace;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-light, #B85C63);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    text-align: left;
    justify-content: flex-start;
}

.breadcrumb a {
    color: var(--accent-light, #B85C63);
    text-decoration: none;
    transition: opacity 0.2s ease, color 0.2s ease;
    opacity: 0.85;
}

.breadcrumb a:hover {
    opacity: 1;
    text-decoration: underline;
}

.breadcrumb .sep,
.breadcrumb svg {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.breadcrumb span.current,
.breadcrumb span.active,
.breadcrumb .current {
    color: var(--color-text-strong);
    font-weight: 400;
    opacity: 1;
}

html[data-theme="light"] .breadcrumb,
html[data-theme="light"] .breadcrumb a {
    color: #A15C55;
}

html[data-theme="light"] .breadcrumb span.current,
html[data-theme="light"] .breadcrumb .current {
    color: #2B2726;
}

/* ── SCREEN 4: RESUMO / DASHBOARD MOCKUP CLASSES ── */
.dash-wrap {
    padding: 24px;
    position: relative;
    z-index: 2;
}

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    padding: 12px 18px;
    border-radius: 10px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 1rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.filter-select {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.10));
    color: var(--color-text-strong);
    outline: none;
    cursor: pointer;
}

.priority-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.priority-label {
    font-size: 1rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-label svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.pri-chip {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.15s ease;
    font-weight: 500;
}

.pri-chip.active {
    background: rgba(147, 66, 74, 0.22);
    border-color: var(--color-primary);
    color: #EEE8D5;
    font-weight: 600;
}

.pri-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.section-head {
    font-size: 0.95rem;
    letter-spacing: .1em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    padding: 16px;
    border-radius: 10px;
    border-left: 3px solid transparent;
}

.kpi-card.blue {
    border-left-color: #268BD2;
}

.kpi-card.green {
    border-left-color: #859900;
}

.kpi-card.yellow {
    border-left-color: #B58900;
}

.kpi-card.accent {
    border-left-color: var(--accent-light, #B85C63);
}

.kpi-label {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.kpi-value {
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--color-text-strong);
    line-height: 1;
}

.kpi-sub {
    font-size: 0.95rem;
    margin-top: 6px;
    font-weight: 500;
}

.kpi-sub.blue {
    color: #268BD2;
}

.kpi-sub.green {
    color: #859900;
}

.kpi-sub.yellow {
    color: #B58900;
}

.kpi-sub.accent {
    color: var(--accent-light, #B85C63);
}

.kpi-ext {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-ext svg {
    width: 11px;
    height: 11px;
    stroke: var(--color-text);
    fill: none;
    stroke-width: 1.5;
}

.metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 540px) {
    .metrics-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.metric-card {
    padding: 16px;
    border-radius: 10px;
}

.metric-label {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--color-text-strong);
}

.metric-unit {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.metric-sub {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    padding: 16px;
    border-radius: 10px;
}

.chart-title {
    font-size: 1.1rem;
    color: var(--color-text-strong);
    margin-bottom: 14px;
    font-weight: 600;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--color-text);
}

.bar-label {
    width: 110px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    flex: 1;
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #268BD2;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.bar-num {
    width: 20px;
    text-align: right;
    font-weight: 600;
    color: var(--color-text-strong);
}

.donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.donut-svg {
    width: 90px;
    height: 90px;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color: var(--color-text);
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}


.btn-voltar svg {
    width: 15px;
    height: 15px;
    stroke: #FFFFFF;
    transition: transform 0.2s ease;
}

.btn-voltar:hover svg {
    transform: translateX(-2px);
}

/* ── Glassmorphism para Popups, Modais e Dialogs ── */
.glass-popup,
.custom-modal-card,
.modal-content,
.filtros-avancados,
.projeto-popup-card {
    background: var(--modal-bg) !important;
    backdrop-filter: blur(18px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
    border: 1px solid var(--modal-border) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
}

.custom-modal-overlay,
.modal-overlay {
    background: var(--modal-overlay-bg) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* ── Kbd Component (Command Center) ── */
kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--kbd-bg);
    border: 1px solid var(--kbd-border);
    color: var(--kbd-text);
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Estilos para os ícones */
.nav-icons {
    display: flex;
    /* Habilita Flexbox para os ícones */
    gap: 16px;
    /* Espaçamento entre os ícones (equivalente a space-x-4 do Tailwind) */
    align-items: center;
    /* Alinha os ícones verticalmente ao centro */
}

.nav-icons a {
    color: #ffffff;
    /* Cor do ícone branco */
    transition: color 0.2s ease-in-out;
    /* Transição suave para o hover */
}

.nav-icons a:hover {
    color: #cccccc;
    /* Cor do ícone cinza claro ao passar o mouse */
}

.nav-icons svg {
    width: 25px;
    /* Largura do ícone */
    height: 25px;
    /* Altura do ícone */
}

/* Estilo para ícones SVG no cabeçalho */
.nav-links a svg {
    transition: transform 0.2s ease-in-out;
    /* Transição suave para o efeito */
}

.nav-links a.active-nav svg,
.nav-links a:hover svg {
    transform: scale(1.1);
    /* Aumenta um pouco o ícone ao passar o mouse ou se estiver ativo */
}


.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* =========================================================
 * DESIGN SYSTEM — CABEÇALHOS INSTITUCIONAIS
 * =========================================================
 * Padrão Aprovado:
 * - Breadcrumb acima do título, alinhado à esquerda.
 * - H1: 28px, font-weight 600.
 * - Subtítulo: 14px, font-weight 400.
 * - Espaçamento breadcrumb → título: 12px.
 * - Espaçamento título → subtítulo: 6px.
 * - Alinhamento à esquerda, seguindo o eixo do conteúdo principal.
 * - Preservar a família tipográfica institucional existente.
 * - Não forçar caixa alta nos títulos.
 * ========================================================= */

.page-header,
.page-header-section,
.page-title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    margin: 0 0 20px 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.page-header .breadcrumb,
.page-header-section .breadcrumb,
.page-title-section .breadcrumb,
.craai-main > .breadcrumb,
.users-header-title .breadcrumb,
.account-header-section .breadcrumb {
    margin: 0 0 12px 0;
    text-align: left;
    justify-content: flex-start;
    align-self: flex-start;
}

.page-header-title,
.page-header h1,
.page-header-section h1,
.page-title-section h1,
.page-title-section .main-heading,
.main-heading,
.craai-main > .page-title,
.craai-main > h1.page-title,
.users-header-title .main-heading {
    font-family: var(--font-family);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text-strong);
    text-align: left;
    text-transform: none;
    letter-spacing: -0.015em;
    margin: 0 0 6px 0;
}

.main-heading a {
    color: inherit;
    text-decoration: none;
}

.main-heading a:hover {
    text-decoration: underline;
}

.page-header-subtitle,
.page-header p,
.page-header-section p,
.page-title-section p,
.page-title-section .sub-heading,
.sub-heading,
.craai-main > .page-sub,
.craai-main > p.page-sub,
.users-header-title .sub-heading {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-text-muted);
    text-align: left;
    text-transform: none;
    letter-spacing: 0.01em;
    margin: 0;
}

/* Exceção Aprovada: Minha Conta (H1 e subtítulo centralizados em relação à área principal) */
.account-page-title {
    font-family: var(--font-family);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text-strong);
    text-align: center;
    text-transform: none;
    letter-spacing: -0.015em;
    margin: 0 0 6px 0;
}

.account-page-subtitle {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-text-muted);
    text-align: center;
    text-transform: none;
    letter-spacing: 0.01em;
    margin: 0;
}

/* Container principal para o conteúdo da página — Editorial Operacional */
.page-wrapper {
    max-width: var(--container-max);
    margin: var(--space-lg) auto;
    padding: 0 var(--container-padding);
}

/* Layout de Grelha Principal (para index.html e craai.html) */
.content-grid-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-top: 0px;
}

@media (min-width: 1024px) {
    .content-grid-container {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: var(--space-2xl);
        align-items: flex-start;
        margin-top: 0;
    }
}

/* NOVO: Layout específico para a página do mapa, tornando o mapa maior */
.map-grid-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin: var(--spacing-md) 0;
}

@media (min-width: 1024px) {
    .map-grid-container {
        display: grid;
        grid-template-columns: 0.8fr 1fr;
        gap: 80px;
        margin: 80px 30px;
    }
}

/* --- Estilos para o Mapa SVG Interativo --- */
/* A segmentação funciona porque o SVG é carregado inline no HTML */
#map-container svg .map-region {
    fill: #d8d5d2;
    /* Cor de preenchimento padrão para as regiões */
    stroke: #fbf8f5;
    /* Cor da borda (igual ao fundo da página para criar um espaçamento) */
    stroke-width: 1px;
    /* Largura da borda */
    vector-effect: non-scaling-stroke;
    /* NOVO: Mantém a espessura da linha intacta no zoom */
    transition: fill 0.2s ease-in-out;
    /* Animação suave da cor */
    cursor: pointer;
    /* Mostra que a região é clicável */
    font-family: var(--font-sans);
    /* Garante que o texto dentro do SVG use a mesma fonte */
    z-index: 1;
    /* Define a hierarquia base para as regiões */
}

.region-label {
    fill: #7E3C3A;
    /* Cor do texto das regiões */
    pointer-events: none;
    /* Permite clicar na região sem interferir no texto */
    font-family: var(--font-sans);
    stroke: #fbf8f5;
    /* Contorno claro para aumentar o contraste */
    stroke-width: 0.05em;
    /* Usa proporção relativa à fonte, para não engolir o texto */
    paint-order: stroke fill;
    /* O contorno fica atrás do preenchimento */
    font-size: 0.7em;
    z-index: 10;
    /* Garante que o texto fique sempre por cima da região */
    position: relative;
    /* Força o contexto de camadas no SVG */
    transform: translateZ(1px);
    /* Aceleração de hardware para o texto ficar intocável no Zoom */
}

#map-container svg .map-region:hover {
    fill: #b4b4b4;
    /* Cor mais escura ao passar o mouse */
}

#map-container svg .map-region.active {
    fill: #7E3C3A;
    /* Cor da região selecionada (cor principal do tema) */
    stroke-width: 3px;
    /* Largura da borda */
    z-index: 5;
    /* Fica acima da região base, mas sempre abaixo do texto (z-index: 10) */
}

/* NOVO: Muda a cor do texto para branco quando a região está selecionada */
#map-container svg .map-region.active+.region-label,
#map-container svg .map-region.active~.region-label {
    fill: #ffffff;
    stroke: none;
}

.content-grid-container > .sidebar {
    margin-bottom: var(--space-section);
}


/* Restaura o layout original para a homepage, onde o grid é o container principal */
.main-content-wrapper>.content-grid-container {
    max-width: var(--container-max);
    margin: var(--space-lg) auto;
    padding: 0 var(--container-padding);
}

.sidebar .comarcas {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-strong);
    margin-top: -125px;
}

.content-grid-container > .sidebar {
    margin-top: var(--space-sm);
    font-size: var(--font-body);
    margin-left: var(--space-xl);
}

.sidebar h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-strong);
    margin-top: 40px;
    margin-bottom: 20px;
}

/* NOVO: Estilos base para o botão do sidebar (desktop) */
.sidebar-toggle-button {
    /* Faz o botão parecer texto normal no desktop */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: default;
    pointer-events: none;
    /* Desabilita cliques no desktop */
}

/* NOVO: Esconde a seta do dropdown no desktop */
.sidebar-toggle-button::after {
    display: none;
}

.sidebar ul {
    font-size: 1.8rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    height: 50px;
    padding-left: 50px;
    border-radius: 0px 4px 4px 0px;
}

.sidebar ul li a:hover {
    font-weight: bold;
}

.sidebar ul li a.active {
    background-color: var(--color-primary-subtle);
    position: relative;
    color: var(--color-primary-hover);
    font-weight: 500;
}

.sidebar ul li a.active:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 0 2px 2px 0;
}

/* --- Estilos para a Homepage (index.html) --- */

.summary-frame-section {
    background-color: var(--color-surface);
    border-left: 80px;
    padding: var(--space-lg) var(--space-lg) var(--space-2xl);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: none;
    overflow-x: auto;
    margin-top: var(--space-section);
    margin-right: 0;
}

.welcome-message {
    padding: 40px 20px;
    text-align: center;
    color: var(--color-text-muted);
    border-radius: 8px;
    margin-top: 20px;
}

.global-search-container {
    margin-top: 30px;
    padding-top: 30px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.global-search-container h3 {
    color: var(--color-text-muted);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

#global-project-filter {
    width: 100%;
    padding: 12px 12px 12px 45px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#global-search-results-container {
    margin-top: 20px;
    text-align: left;
}

.welcome-message h2 {
    font-size: 1.7em;
    margin-bottom: 10px;
    color: var(--color-text-strong);
}

.summary-kpi-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.summary-kpi-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    transition: box-shadow var(--duration-medium) var(--ease-stripe-default);
}

.summary-kpi-card:hover {
    box-shadow: var(--shadow-md);
}

.summary-kpi-value {
    display: block;
    font-size: 2.2em;
    font-weight: 700;
    color: var(--color-text-strong);
    line-height: var(--leading-tight);
}

.summary-kpi-label {
    display: block;
    font-size: var(--font-sm);
    color: var(--color-text-muted);
    margin-top: 6px;
}

.table-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-light);
}

.project-card .image-container {
    width: 100%;
    /* Largura total em mobile */
    aspect-ratio: 16/9;
    /* Proporção fixa em mobile */
    flex-shrink: 0;
    overflow: hidden;
}

@media (min-width: 768px) {
    .project-card .image-container {
        width: 300px;
        /* Largura fixa no desktop */
        height: 200px;
        /* ALINHADO: Altura fixa no desktop para tamanho 100% padronizado */
        border-radius: 6px;
        /* Estética premium */
        align-self: center;
        margin: 20px;
    }
}

.project-card .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Recorta e preenche o espaço sem distorcer */
    display: block;
}

.project-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
}

.project-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    /* NOVO: Garante que a tabela tenha uma largura mínima, forçando a barra de rolagem horizontal em telas pequenas. */
    min-width: 750px;
}

.project-table th,
.project-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.project-table thead th {
    background-color: var(--color-surface-subtle);
    font-weight: 600;
    color: var(--color-text);
    font-size: var(--font-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.project-table tbody tr:nth-child(even) {
    background-color: #F4F5F759;
}

.status-tag {
    background-color: var(--color-surface-subtle);
    color: var(--color-text-body);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.status-tag.status-concluido {
    background-color: var(--color-status-success-bg);
    color: var(--color-status-success-tx);
}

.status-tag.status-paralisado {
    background-color: var(--color-status-warning-bg);
    color: var(--color-status-warning-tx);
}

.status-tag.status-em-andamento {
    background-color: var(--color-status-info-bg);
    color: var(--color-status-info-tx);
}

.status-tag.status-planejamento {
    background-color: var(--color-surface-hover);
    color: var(--color-text-strong);
}

/* --- Estilos para a Página de Comarcas (craai.html) --- */

.project-cards-section {
    display: grid;
    grid-template-columns: 1fr;
    /* Cada card ocupa a linha toda da seção */
    gap: 30px;
    padding-left: 0;
    /* Remove o padding esquerdo fixo */
}

.project-card,
.projeto-card,
.projeto-popup-card,
.endereco-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
    min-height: 230px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border-radius: 10px;
    transition:
        transform var(--duration-medium) var(--ease-stripe-default),
        box-shadow var(--duration-medium) var(--ease-stripe-default),
        border-color var(--duration-medium) ease;
}

/* Efeito de hover elevado apenas para cards de projetos clicáveis */
.projeto-card:hover,
.projeto-popup-card:hover,
.project-card:not(.endereco-card):hover {
    transform: translate3d(0, -6px, 0) scale(1.008);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
}

.projeto-card:active,
.projeto-popup-card:active,
.project-card:not(.endereco-card):active {
    transform: translate3d(0, -2px, 0) scale(0.99);
    transition-duration: var(--duration-fast);
}

/* Cards de Endereço não possuem elevação no hover */
.endereco-card {
    cursor: default;
}

.endereco-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--color-border-light);
}

@media (min-width: 768px) {
    .project-card {
        flex-direction: row;
        /* Desktop: lado a lado */
    }
}

.project-card .image-container {
    width: 100%;
    /* Largura total em mobile */
    aspect-ratio: 16/9;
    /* Mantém a proporção da imagem */
    flex-shrink: 0;
    overflow: hidden;
}

@media (min-width: 768px) {
    .project-card .image-container {
        width: 300px;
        /* Largura fixa no desktop */
        aspect-ratio: auto;
        /* Deixa a altura livre dependendo do arquivo */
        align-self: center;
        margin: 20px;
    }
}

.project-card .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


.project-card .card-content {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-grow: 1;
}

@media (min-width: 768px) {
    .project-card .card-content {
        border-left: 1px solid var(--color-border-light);
        padding: 28px 32px;
    }
}

.card-content .card-tipologia {
    grid-area: tipologia;
    text-transform: uppercase;
    font-size: var(--font-xs);
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    font-weight: 600;
    padding: 0;
    margin: 0;
}

.card-content .card-titulo {
    grid-area: titulo;
    font-size: 1.166rem;
    font-weight: 700;
    color: var(--color-text-strong);
    line-height: var(--leading-normal);
    align-items: center;
    padding: 0;
    margin: 0;
}

.card-content .card-endereco {
    grid-area: endereco;
    font-size: var(--font-sm);
    font-weight: 400;
    color: var(--color-text-subtle);
    padding: 0;
    margin: 0;
}

.card-content .card-descricao {
    grid-area: descricao;
    font-size: var(--font-body);
    color: var(--color-text-body);
    line-height: var(--leading-relaxed);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.card-content .status-area {
    grid-area: status-area;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: flex-end;
}

.card-content .status {
    font-size: 1.4rem;
    color: var(--color-text-muted);
    margin-bottom: 0px;
}

.card-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-sm);
    transition:
        background-color var(--duration-fast) ease,
        transform var(--duration-fast) var(--ease-stripe-default),
        box-shadow var(--duration-fast) ease;
    box-shadow: var(--shadow-sm);
}

.card-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.footer {
    background-color: var(--color-bg-elevated);
    color: rgba(255, 255, 255, 0.5);
    padding: 0 var(--space-xl);
    height: 80px;
    min-height: 80px;
    box-sizing: border-box;
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2xl);
    flex-shrink: 0;
}

.footer p {
    margin: 0;
    font-size: var(--font-xs);
    opacity: 0.7;
}

.footer svg,
.footer-logo {
    height: 36px;
    max-height: 36px;
    width: auto;
}

/* --- Estilos para o Menu Dropdown --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown .nav-button {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    background-color: var(--color-surface);
    min-width: 240px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
    list-style: none;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    overflow-y: auto !important;
    max-height: 50vh !important;
    position: absolute;
    left: 0;
    top: 100%;
    width: 291px;
}

/* O menu agora é exibido com uma classe, controlada por JS */
.dropdown.is-open .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: var(--color-text-body);
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: var(--font-sm);
    transition: background-color var(--duration-fast) ease;
}

.dropdown-menu a:hover {
    background-color: var(--color-surface-hover);
}

.carregando,
.erro,
.sem-projetos {
    text-align: center;
    padding: 50px;
    font-size: 1.1em;
    color: #888;
}

.erro {
    color: #d9534f;
}

.mapa2-scroll-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 25px;
    padding: 12px;
    background: #f1f3f5;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-strong);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mapa2-scroll-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: #000;
}

/* Responsividade Mapa V2 */
/* --- Media Queries para Responsividade --- */
@media (max-width: 1024px) {
    .content-grid-container {
        grid-template-columns: 1fr;
        max-width: 95%;
        margin: 0 auto 10px auto;
        gap: 30px;
    }


    .table-header-controls {
        display: grid;
    }

    .table-header-controls .table-title {
        width: 320px;
    }

    .table-header-controls #table-filter-input {
        margin: 5px auto;
        width: 90%;
    }

    .summary-frame-section {
        margin: 0 auto;
        padding: 15px;
        width: 90%;
    }

    /* --- Mobile Navigation Overrides --- */
    .nav-container {
        max-width: 90%;
        /* Largura máxima do conteúdo */
        max-width: 100%;
        padding: 0 var(--spacing-sm);
        height: 5rem;
    }


    /* --- Tablet Navigation Adaptations (mobile-nav handles <= 992px) --- */
    .nav-container {
        max-width: 95%;
        padding: 0 var(--spacing-sm);
        height: 5rem;
    }

    .desktop-nav .nav-links {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        margin: 0 auto;
    }

    .desktop-nav .nav-links a {
        font-size: 0.95rem;
        padding: 6px 4px;
        width: auto;
    }

    .desktop-nav .nav-user-group {
        display: flex;
        gap: 12px;
    }

    /* NOVO: Inverte a ordem do conteúdo e da barra lateral em telas pequenas (específico para a homepage) */
    /* Este seletor garante que a regra só se aplique ao grid da página inicial */
    .main-content-wrapper>.content-grid-container {
        display: flex;
        flex-direction: column;
    }

    /* ATUALIZADO: O seletor agora aponta para a <section> em vez de <main> para corresponder ao HTML da index.php */
    .main-content-wrapper>.content-grid-container>.summary-frame-section {
        order: 2;
        /* O container do resumo aparece depois do menu */
        margin-top: 5px;
        /* Ajusta o espaçamento superior em mobile */
    }

    .main-content-wrapper>.content-grid-container>aside.sidebar {
        order: 1;
        /* Barra lateral (menu CRAAI) aparece primeiro */
    }

    /* ATUALIZADO: Transforma as barras laterais (CRAAI e Comarcas) em um dropdown em mobile */
    /* A regra agora se aplica a qualquer sidebar com um h2 e uma lista */

    .main-heading {
        font-size: 24px;
        font-weight: 600;
    }

    .sub-heading {
        font-size: 14px;
        font-weight: 400;
    }

    .content-grid-container > .sidebar,
    .page-wrapper .sidebar {
        margin-top: 30px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        background-color: var(--color-surface);
        box-shadow: none;
        width: 98%;
        margin: auto;
    }

    .content-grid-container > .sidebar h2,
    .page-wrapper .sidebar h2 {
        /* O padding e outros estilos foram movidos para o botão para um melhor controle */
        margin: 0;
    }

    /* ATUALIZADO: Estilos para o botão se tornar interativo em mobile */
    .sidebar-toggle-button {
        /* Faz o botão preencher o H2 */
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        pointer-events: auto;
        /* Reabilita cliques em mobile */
        box-sizing: border-box;
        padding: 15px 20px;
        font-size: 0.9em;
        font-weight: 600;
    }

    .sidebar-toggle-button::after {
        display: inline-block;
        /* Mostra a seta em mobile */
        content: '▼';
        font-size: 0.7em;
        color: #888;
        transition: transform 0.2s ease;
    }

    .sidebar.is-open .sidebar-toggle-button::after {
        transform: rotate(180deg);
    }

    .content-grid-container > .sidebar ul,
    .page-wrapper .sidebar ul {
        display: none;
        border-top: 1px solid #eee;
    }

    .content-grid-container > .sidebar.is-open ul,
    .page-wrapper .sidebar.is-open ul {
        display: block;
    }

    .content-grid-container > .sidebar .comarcas,
    .page-wrapper .sidebar .comarcas {
        margin-top: 0;
        /* Remove a margem superior padrão para um alinhamento previsível */
    }

    /* NOVO: Reordena os elementos na página de projetos (craai.php) em mobile */
    /* ATUALIZADO: Aplica flexbox ao .page-wrapper para reordenar seus filhos diretos */
    .page-wrapper {
        display: flex;
        flex-direction: column;
        margin: 25px auto;
        max-width: 98%;
    }

    .page-wrapper>.page-title-section {
        order: 0;
        /* O título da página aparece depois */
    }

    .page-wrapper>.content-grid-container {
        order: 1;
        /* O container com o menu e os cards aparece primeiro */
        display: flex;
        flex-direction: column;
        gap: 30px;
        margin-top: 0;
        max-width: 98%;
    }

    .page-wrapper .sidebar {
        order: 0;
        /* O menu de comarcas aparece primeiro */
    }

    .page-wrapper .project-cards-section {
        order: 2;
        /* Os cards de projeto aparecem depois */
        max-width: 98%;
        margin: 0 auto;
    }

    /* NOVO: Ajustes otimizados para o rodapé no mobile */
    .footer {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 14px 16px !important;
        height: auto !important;
        min-height: auto !important;
        text-align: center !important;
    }

    .footer p {
        font-size: 0.95rem !important;
        line-height: 1.35 !important;
        margin: 0 !important;
    }

    .footer-logo {
        height: 28px !important;
        max-height: 28px !important;
    }



}

@media (max-width: 768px) {
    .summary-kpi-container {
        grid-template-columns: 1fr;
    }

    .project-table {
        font-size: 0.85em;
    }

    .project-table th,
    .project-table td {
        padding: 8px 10px;
    }
}

/* NOVO: Container para páginas com largura limitada como 'gerenciar_usuarios' */
.page-container-narrow {
    max-width: 950px;
    margin: 20px auto;
    padding-top: 20px;
}

/* --- Estilos para Formulários e Páginas de Gestão --- */
.form-container {
    background-color: var(--color-surface);
    padding: var(--space-lg) var(--space-xl);
    box-shadow: var(--shadow-sm);
    margin: var(--space-lg) auto;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text-body);
    font-size: var(--font-sm);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
    font-family: var(--font-family);
    transition: border-color var(--duration-fast) ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

.login-button {
    padding: 14px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color var(--duration-fast) ease,
        transform var(--duration-fast) var(--ease-stripe-default);
    margin-top: 10px;
}

.login-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

/* --- Estilos para Mensagens de Feedback --- */
.error-message {
    color: #c0392b;
    background-color: #fbeae5;
    border: 1px solid #e4a99b;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.95em;
    transition: opacity 0.1s ease;
}

.success-message {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 15px;
    transition: opacity 0.5s ease;
}

.success-message-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 15px;
    transition: opacity 0.5s ease;
}

/* --- Estilos para a página de Gerenciar Usuários --- */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.user-table th,
.user-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.user-table th {
    background-color: var(--color-surface-subtle);
}

.update-btn {
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.update-btn:hover {
    background-color: #218838;
}

.update-cargo-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0;
}

.update-cargo-form select {
    padding: 5px;
    font-size: 0.9em;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.delete-btn:hover {
    background-color: #c82333;
}

.admin-badge {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.user-badge {
    background-color: var(--color-surface-subtle);
    color: var(--color-text-body);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}


/* --- Modificadores de Visualização para Homepage --- */
.action-cards-container.compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 1rem !important;
}

.action-cards-container.compact a {
    padding: 1.5rem 1rem !important;
}

.action-cards-container.compact a div {
    width: 45px !important;
    height: 45px !important;
    margin-bottom: 0.5rem !important;
}

.action-cards-container.compact a svg {
    width: 24px !important;
    height: 24px !important;
}

.action-cards-container.compact a h3 {
    font-size: 1.1rem !important;
    margin-bottom: 0 !important;
}

.action-cards-container.compact a p {
    display: none !important;
}

/* --- Estilos para o Boletim --- */
.boletim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.boletim-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition:
        transform var(--duration-medium) var(--ease-stripe-default),
        box-shadow var(--duration-medium) var(--ease-stripe-default),
        border-color var(--duration-medium) ease;
    display: flex;
    flex-direction: column;
}

.boletim-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-border);
}

.boletim-tag {
    display: inline-block;
    background: transparent;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(126, 60, 58, 0.25);
    align-self: flex-start;
    width: fit-content;
}

html[data-theme="dark"] .boletim-tag {
    background: rgba(229, 152, 155, 0.18);
    color: #e5989b;
    border-color: rgba(229, 152, 155, 0.3);
}

.boletim-card h4 {
    margin: 0 0 10px 0;
    color: var(--color-text-strong);
    font-size: 1.2em;
    font-weight: 600;
    line-height: var(--leading-normal);
}

.boletim-date {
    font-size: var(--font-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.boletim-excerpt {
    color: var(--color-text-body);
    font-size: var(--font-body);
    line-height: var(--leading-relaxed);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: var(--space-md);
    flex-grow: 1;
}

.ler-mais {
    color: #7E3C3A;
    font-weight: 700;
    font-size: 0.9em;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ler-mais:hover {
    text-decoration: underline;
}

/* --- Modal Boletim --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--color-surface);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    padding: 40px;
    position: relative;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    font-size: 3.2rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #7E3C3A;
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        padding: 24px 16px;
    }

    .modal-close {
        top: 10px;
        right: 12px;
        font-size: 2.2rem;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
}

/* ================================================
   CARD DE PERFIL - ORGANOGRAMA
   ================================================ */

/* Container para alinhar múltiplos cards de equipe lado a lado sem sobreposição */
.equipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 350px));
    justify-content: center;
    gap: 32px !important;
    /* Distância entre os cards */
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

.card {
    background-color: var(--color-surface);
    padding: 30px;
    border-radius: var(--radius-md);
    border: none !important;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
    margin-bottom: 0;
    width: 100%;
    min-width: min(100%, 350px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: border-color var(--duration-medium) ease;
    overflow: hidden;
}

/* ================================================
   CABEÇALHO DO CARD (FLEXBOX)
   ================================================ */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.card-teams-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.card-teams-icon:hover {
    opacity: 0.8;
}

/* ================================================
   CORPO DO CARD (TEXTOS)
   ================================================ */

.card-body {
    margin-top: 15px;
    font-family: var(--font-sans);
}

.card-name {
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--color-text-strong);
    margin: 0;
    line-height: 1.2;
    text-align: left;
}

.card-role {
    font-size: 2rem;
    font-weight: 400;
    color: var(--color-text-muted);
    margin: 8px 0 0 0;
    text-align: left;
}

.card-team {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--color-text-muted);
    margin: 8px 0 0 0;
    text-align: left;
}

/* ================================================
   RODAPÉ DO CARD (EMAIL)
   ================================================ */

.card-footer {
    margin-top: auto;
    /* Empurra o rodapé e botões sempre para o fundo */
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.card-email {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text-subtle);
    margin: 0;
    word-break: break-word;
    text-align: left;
}

/* ================================================
   BOTÕES DE AÇÃO DO CARD
   ================================================ */

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.card-action-btn {
    flex: 1;
    padding: 8px;
    font-family: var(--font-sans);
    border-radius: 4px;
    border: none;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    color: white;
}

.card-action-btn:hover {
    opacity: 0.8;
}

.card-teams-btn {
    background-color: #6264A7;
}

.card-projects-btn {
    color: #777777;
    background-color: #ffffff;
    font-weight: lighter;
    justify-content: left;
    padding-left: 0px;
}

.card-projects-btn:hover {
    background-color: #e2e6ea;
}

/* --- Mapa Interativo V2 --- */
.mapa2-page {
    max-width: var(--container-max);
    margin: 25px auto 48px;
}

.mapa2-shell {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: none;
    padding: 18px;
}

.mapa2-toolbar {
    height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 18px;
}

.mapa2-control-button,
.mapa2-link-button,
.mapa2-option-list a,
.mapa2-option-list button,
.mapa2-rio-summary-options button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border: 0;
    border-radius: 4px;
    background: #7E3C3A;
    color: #ffffff;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 600;
    padding: 9px 14px;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.mapa2-control-button:hover,
.mapa2-link-button:hover,
.mapa2-option-list a:hover,
.mapa2-option-list button:hover,
.mapa2-rio-summary-options button:hover {
    background: #643838;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(126, 60, 58, 0.18);
}

.mapa2-control-button[hidden] {
    display: none;
}

.mapa2-status {
    color: #706b67;
    font-size: 0.95em;
    margin-left: auto;
}

.mapa2-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 22px;
    align-items: stretch;
    height: 560px;
}

.mapa2-map-panel {
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background:
        linear-gradient(90deg, rgba(126, 60, 58, 0.03) 1px, transparent 1px),
        linear-gradient(180deg, rgba(126, 60, 58, 0.03) 1px, transparent 1px),
        var(--color-bg);
    background-size: 36px 36px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    padding: 20px;
}

#btn-reset-zoom {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
}

.mapa2-map-panel .map-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mapa2-map-panel svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 18px 22px rgba(61, 43, 39, 0.12));
    animation: mapa2FadeIn 0.55s ease both;
}

.mapa2-map-panel .map-region {
    cursor: pointer;
    outline: none;
    transform-box: fill-box;
    transform-origin: center;
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
    animation: mapa2RegionIn 0.42s ease both;
    animation-delay: calc(var(--mapa2-index, 0) * 32ms);
}

.mapa2-map-panel .map-region path,
.mapa2-map-panel .map-region polygon {
    fill: #d8d5d2;
    stroke: #8d8d8d;
    stroke-width: 1.2px;
    vector-effect: non-scaling-stroke;
    transition: fill 0.25s ease, stroke 0.25s ease, stroke-width 0.25s ease;
}

.mapa2-map-panel .map-region:hover,
.mapa2-map-panel .map-region:focus-visible {
    transform: translateY(-2px) scale(1.015);
    filter: drop-shadow(0 6px 8px rgba(61, 43, 39, 0.22));
}

.mapa2-map-panel .map-region:hover path,
.mapa2-map-panel .map-region:focus-visible path,
.mapa2-map-panel .map-region:hover polygon,
.mapa2-map-panel .map-region:focus-visible polygon {
    fill: #b9aba6;
    stroke: #6f6f6f;
}

.mapa2-map-panel .map-region.active path,
.mapa2-map-panel .map-region.active polygon {
    fill: #7E3C3A;
    stroke: #8d8d8d;
    stroke-width: 2px;
}

.mapa2-map-panel .region-label {
    fill: #7E3C3A;
    pointer-events: none;
    font-family: var(--font-sans);
    font-weight: 800;
    paint-order: stroke fill;
    stroke: #ffffff;
    stroke-width: 0.08em;
    transition: fill 0.25s ease, opacity 0.25s ease;
}

.mapa2-map-panel .map-region.active .region-label {
    fill: #ffffff;
    stroke: rgba(126, 60, 58, 0.55);
}

.mapa2-info-panel {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    padding: 26px;
    color: var(--color-text-body);
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.mapa2-kicker {
    margin: 0 0 8px;
    color: #7E3C3A;
    font-size: 0.78em;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.mapa2-info-panel h2 {
    color: var(--color-text-strong);
    font-size: 1.5em;
    margin: 0 0 12px;
}

.mapa2-info-panel p {
    line-height: 1.55;
}

.mapa2-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.mapa2-info-grid div {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface-subtle);
    padding: 16px;
}

.mapa2-info-grid strong {
    display: block;
    color: #7E3C3A;
    font-size: 1.8em;
    line-height: 1;
}

.mapa2-info-grid span {
    display: block;
    color: #76706b;
    font-size: 0.86em;
    margin-top: 7px;
}

.mapa2-area {
    border-top: 1px solid #eee7e1;
    padding-top: 16px;
}

.mapa2-option-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.mapa2-option-list a,
.mapa2-option-list button {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.95em;
}

.mapa2-summary-section {
    margin: 22px 0 0;
    padding: 24px 26px 32px;
    box-shadow: none;
}

.mapa2-rio-summary-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.mapa2-loading {
    color: #76706b;
}

@keyframes mapa2FadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mapa2RegionIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 980px) {
    .mapa2-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .mapa2-info-panel {
        height: auto;
        overflow-y: visible;
    }

    .mapa2-map-panel {
        min-height: auto;
        padding: 12px;
    }

    .mapa2-map-panel .map-wrapper {
        min-height: 420px;
    }

    .mapa2-map-panel svg {
        height: 58vh;
        min-height: 390px;
    }
}

@media (max-width: 640px) {
    .mapa2-shell {
        padding: 12px;
    }

    .mapa2-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .mapa2-status {
        margin-left: 0;
    }

    .mapa2-info-grid {
        grid-template-columns: 1fr;
    }

    .mapa2-map-panel .map-wrapper {
        min-height: 320px;
    }

    .mapa2-map-panel svg {
        min-height: 310px;
        height: 52vh;
    }
}

/* Organograma Styles */
.organograma-wrapper svg {
    max-width: 100%;
    height: auto;
    max-height: 75vh;
    display: inline-block;
    margin: 0 auto;
    min-width: 800px;
}

/* Tooltip de Informação (Demandas Diversas) */
.info-tooltip-container {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    align-items: center;
    vertical-align: middle;
}

.info-tooltip-box {
    visibility: hidden;
    width: 450px;
    background-color: var(--color-surface);
    color: var(--color-text-body);
    text-align: justify;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    position: absolute;
    z-index: 10000;
    top: 125%;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    font-weight: normal;
    line-height: 1.6;
    text-transform: none;
    text-indent: 0;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.info-tooltip-container:hover .info-tooltip-box {
    visibility: visible;
    opacity: 1;
}

.info-tooltip-arrow {
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent;
    filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.05));
}

.info-tooltip-arrow-border {
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #e9ecef transparent;
    z-index: -1;
}

@media (max-width: 768px) {
    .info-tooltip-box {
        width: 280px;
        left: auto;
        right: -20px;
        transform: none;
    }

    .info-tooltip-arrow,
    .info-tooltip-arrow-border {
        left: 90%;
    }
}

/* ==========================================================================
   DESIGN SYSTEM COMPONENT CLASSES — Command Center
   ========================================================================== */

/* ── Botão Primário ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-white);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--font-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition:
        transform var(--duration-fast) var(--ease-stripe-default),
        box-shadow var(--duration-fast) ease,
        background var(--duration-fast) ease;
}

.btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Botão Secundário ── */
.btn--secondary {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-surface-hover);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.btn--secondary:active {
    background: var(--color-surface-subtle);
}

/* ── Botão Ghost ── */
.btn--ghost {
    background: transparent;
    color: var(--color-primary-hover);
    border: none;
    padding: 8px 16px;
}

.btn--ghost:hover {
    background: var(--color-primary-subtle);
    box-shadow: none;
}

.btn--ghost:active {
    background: rgba(126, 60, 58, 0.2);
}

/* ── Card Base ── */
.card {
    padding: 24px 28px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: none;
    transition:
        border-color var(--duration-medium) ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* ── Action Card (Homepage atalhos) ── */
.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    transition:
        border-color var(--duration-medium) ease,
        box-shadow var(--duration-medium) ease;
    box-shadow: none;
}

.action-card:hover {
    border-color: var(--color-border-focus);
    box-shadow: var(--shadow-glow);
}

.action-card h3 {
    color: var(--color-text-strong);
    font-size: var(--font-h3);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.action-card p {
    font-size: var(--font-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
}

/* ==========================================================================
   HEADER 60PX, NAV-ITEMS & EYEBROW-BACK BUTTON (Mockup Redesign)
   ========================================================================== */

.header {
    background: var(--header-bg, #412125);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 28px !important;
    height: 60px !important;
    display: flex;
    align-items: center;
    gap: 32px;
    position: relative;
    z-index: 100;
}

.header-logo {
    width: 160px !important;
    height: auto !important;
    max-height: 40px !important;
    object-fit: contain;
}

.nav-collapsible {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center !important;
    margin: 0 auto;
    height: 100%;
}

.nav-links .dropdown {
    display: flex;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
}

.nav-links a,
.nav-links .nav-button,
.nav-item {
    font-size: 1.3rem !important;
    letter-spacing: .08em !important;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78) !important;
    cursor: pointer;
    padding: 6px 0 !important;
    position: relative;
    border-bottom: none !important;
    text-decoration: none;
    font-weight: normal;
    transition: color 0.2s ease;
    background: transparent !important;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Animação suave da linha vermelha no hover e estado active */
.nav-links a::after,
.nav-links .nav-button::after,
.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #B85C63;
    transform: scaleX(0);
    transform-origin: bottom center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

.nav-links a:hover,
.nav-links .nav-button:hover,
.nav-item:hover {
    color: #EEE8D5 !important;
}

.nav-links a:hover::after,
.nav-links .nav-button:hover::after,
.nav-item:hover::after,
.nav-links a.active-nav::after,
.nav-links .nav-button.active-nav::after,
.nav-item.active::after {
    transform: scaleX(1);
}

.nav-links a.active-nav,
.nav-links .nav-button.active-nav,
.nav-item.active {
    color: #EEE8D5 !important;
}

/* Botão Voltar Minimalista (.eyebrow-back) estilo saiba-mais.php */
.top-bar-outside-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 28px 0;
    display: flex;
    align-items: center;
}

.eyebrow-back {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wine-soft, #B85C63);
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.eyebrow-back:hover {
    opacity: 0.85;
    transform: translateX(-2px);
    color: var(--accent-light, #B85C63);
}

html[data-theme="light"] .eyebrow-back {
    color: #A15C55;
}

/* Adjustments for Solarized Light Glass elements */
/* Adjustments for Solarized Light Glass elements */
html[data-theme="light"] {
    --color-bg: #fbf8f5;
    --color-bg-elevated: #F0F2F5;
    --color-white: #FFFFFF;
    --color-surface: #FFFFFF;
    --color-surface-subtle: #F4F5F7;
    --color-surface-hover: #E9EBEE;
    --color-text-strong: #101828;
    --color-text: #101828;
    --color-text-body: #475467;
    --color-text-muted: #98A2B3;
    --color-text-subtle: #98A2B3;
    --color-border: #DFE3E8;
    --color-border-light: #EAECEF;
    --color-border-focus: rgba(107, 52, 57, 0.6);
    --color-primary: #6B3439;
    --color-primary-hover: #4E2529;
    --color-primary-subtle: rgba(107, 52, 57, 0.08);
    --color-primary-glow: rgba(107, 52, 57, 0.25);

    --bg: #fbf8f5;
    --bg2: #F0F2F5;
    --wine: #6B3439;
    --wine-dark: #4E2529;
    --wine-soft: #A15C55;
    --accent: #7E3C3A;
    --accent-light: #A15C55;
    --text: #475467;
    --text-hi: #101828;
    --text-br: #101828;
    --green: #10B981;
    --yellow: #F59E0B;
    --blue: #3B82F6;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(107, 52, 57, 0.15);
    --glass-blur: blur(14px);
    --header-bg: #6B3439;
    --footer-bg: #6B3439;
}

html[data-theme="light"] .header {
    background: #6B3439 !important;
}

html[data-theme="light"] .footer,
html[data-theme="light"] footer {
    background: #6B3439 !important;
}

html[data-theme="light"] .home-greeting {
    color: var(--color-text-strong) !important;
}

html[data-theme="dark"] .home-greeting {
    color: var(--color-text-strong) !important;
}

html[data-theme="light"] .glass,
html[data-theme="light"] .card,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .projeto-card,
html[data-theme="light"] .projeto-popup-card,
html[data-theme="light"] .ultimas-atualizacoes-section,
html[data-theme="light"] .summary-frame-section {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.40) !important;
    border-radius: 10px !important;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(16, 24, 40, 0.05)) !important;
    color: var(--color-text, #101828) !important;
    position: relative;
    z-index: 2;
}

/* Transparência de 0.50 para o home-panel glass no Tema Claro */
html[data-theme="light"] .home-panel {
    background: rgba(255, 255, 255, 0.50) !important;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.40) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(16, 24, 40, 0.05)) !important;
    color: var(--color-text, #101828) !important;
    position: relative;
    z-index: 2;
}

/* Background separado e destacado para os shortcuts no Tema Claro */
html[data-theme="light"] .shortcut {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border: 1px solid rgba(107, 52, 57, 0.15) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    color: #101828 !important;
    position: relative;
    z-index: 2;
}

html[data-theme="light"] .shortcut:hover {
    background: rgba(107, 52, 57, 0.10) !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 16px rgba(107, 52, 57, 0.12) !important;
}

/* Fallback para navegadores sem suporte a backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {

    html[data-theme="light"] .glass,
    html[data-theme="light"] .card,
    html[data-theme="light"] .kpi-card,
    html[data-theme="light"] .metric-card,
    html[data-theme="light"] .chart-card,
    html[data-theme="light"] .shortcut,
    html[data-theme="light"] .home-panel {
        background: var(--color-surface, #FFFFFF) !important;
    }
}

html[data-theme="dark"] .glass,
html[data-theme="dark"] .card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .projeto-card,
html[data-theme="dark"] .projeto-popup-card,
html[data-theme="dark"] .ultimas-atualizacoes-section,
html[data-theme="dark"] .summary-frame-section {
    background: rgba(7, 54, 66, 0.65) !important;
    backdrop-filter: blur(16px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    position: relative;
    z-index: 2;
}

/* Transparência de 0.50 para o home-panel glass no Tema Escuro */
html[data-theme="dark"] .home-panel {
    background: rgba(7, 54, 66, 0.50) !important;
    backdrop-filter: blur(16px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    position: relative;
    z-index: 2;
}

/* Background separado e destacado para os shortcuts no Tema Escuro */
html[data-theme="dark"] .shortcut {
    background: rgba(0, 25, 34, 0.55) !important;
    backdrop-filter: blur(10px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    color: var(--color-text-strong) !important;
    position: relative;
    z-index: 2;
}

html[data-theme="dark"] .shortcut:hover {
    background: rgba(147, 66, 74, 0.25) !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="light"] .sc-label {
    color: #101828 !important;
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .gp-sidebar {
    background: rgba(249, 250, 251, 0) !important;
    border-right: 1px solid #f5eee7 !important;
}

html[data-theme="light"] .tabs-scroll {
    background: rgba(255, 255, 255, 0.85) !important;
    border-bottom: 1px solid #DFE3E8 !important;
}

html[data-theme="light"] .sidebar-title,
html[data-theme="light"] .gp-sidebar-title {
    color: var(--color-text-muted) !important;
}

html[data-theme="light"] .sidebar-item,
html[data-theme="light"] .tree-item {
    color: var(--color-text) !important;
}

html[data-theme="light"] .sidebar-item:not(.comarca-item):hover,
html[data-theme="light"] .tree-item:hover {
    color: var(--color-text-strong) !important;
    background: rgba(107, 52, 57, 0.08) !important;
}

html[data-theme="light"] .sidebar-item.active:not(.comarca-item),
html[data-theme="light"] .tree-item.active {
    color: #6B3439 !important;
    border-left-color: #6B3439 !important;
    border-left-width: 2.4px !important;
    background: rgba(126, 60, 58, 0.05) !important;
}

html[data-theme="dark"] .sidebar-item.active:not(.comarca-item),
html[data-theme="dark"] .tree-item.active {
    border-left-color: rgba(155, 61, 58, 1) !important;
    background: rgba(147, 66, 74, 0.45) !important;
}

/* Regras de transparência total e animação no hover para os itens de Comarca na Sidebar */
.sidebar-item {
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
}

/* Hover de movimento apenas para itens de sidebar padrão (NÃO comarca e NÃO ativos) */
.sidebar-item:not(.active):not(.comarca-item):hover {
    transform: translateX(3px) !important;
}

/* Comarca sem efeito de movimento no hover */
.sidebar-item.comarca-item:hover,
.sidebar-item.comarca-item:not(.active):hover {
    transform: none !important;
}

/* Desativa animação de movimento (transform) para qualquer item ativo, inclusive no hover */
.sidebar-item.active,
.sidebar-item.active:hover,
.sidebar-item.comarca-item.active,
.sidebar-item.comarca-item.active:hover {
    transform: none !important;
}

/* Fundo 100% transparente para Comarca em qualquer tema (ativo ou hover) */
.sidebar-item.comarca-item,
html[data-theme="light"] .sidebar-item.comarca-item,
html[data-theme="dark"] .sidebar-item.comarca-item,
.sidebar-item.comarca-item.active,
html[data-theme="light"] .sidebar-item.comarca-item.active,
html[data-theme="dark"] .sidebar-item.comarca-item.active,
.sidebar-item.comarca-item:hover,
html[data-theme="light"] .sidebar-item.comarca-item:hover,
html[data-theme="dark"] .sidebar-item.comarca-item:hover {
    background: transparent !important;
    background-color: transparent !important;
}

/* Hover das comarcas: sem fundo, apenas deixa o texto em negrito (bold) */
.sidebar-item.comarca-item:hover {
    font-weight: bold !important;
}

/* COMARCA ACTIVE: Sem border-left (espessura zero) e com fundo transparente */
html[data-theme="light"] .sidebar-item.comarca-item.active,
html[data-theme="light"] .sidebar-item.comarca-item.active:hover {

    color: #6B3439 !important;
    font-weight: bold !important;
}

html[data-theme="dark"] .sidebar-item.comarca-item.active,
html[data-theme="dark"] .sidebar-item.comarca-item.active:hover {

    font-weight: bold !important;
}

html[data-theme="light"] .tree-count {
    background: rgba(107, 52, 57, 0.1) !important;
    color: var(--color-text) !important;
}

/* ACESSIBILIDADE — REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ── ORGANOGRAMA COMPACTO PARA MONITOR 1280X800 ── */
#organograma-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-height: calc(100vh - 275px) !important;
    padding: 0 !important;
    margin: 0 auto !important;
    overflow: hidden !important;
}

#organograma-container svg,
#organograma-container img {
    max-height: calc(100vh - 275px) !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
}

/* ==========================================================================
   RESPONSIVO: LISTAGEM DE PROJETOS (CRAAIs) - MOBILE
   ========================================================================== */
@media (max-width: 768px) {

    /* 1. Remover Sidebar e Expandir Main */
    .craai-layout {
        display: block !important;
    }

    .sidebar {
        display: none !important;
    }

    .craai-main {
        width: 100% !important;
        padding: 10px 15px !important;
        box-sizing: border-box;
    }

    /* 2. Empilhar Toolbar */
    .search-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    .search-bar .search-input {
        width: 100% !important;
        box-sizing: border-box;
    }

    .search-bar .view-btns {
        flex-wrap: wrap !important;
        width: 100%;
        justify-content: flex-start;
    }

    /* 3. Tipografia Menor */
    .craai-main .page-title {
        font-size: 24px !important;
        font-weight: 600 !important;
        text-align: left !important;
    }

    .craai-main .page-sub {
        font-size: 14px !important;
        font-weight: 400 !important;
        margin-bottom: 15px !important;
        text-align: left !important;
    }

    /* 4. Corrigir Cards de Projeto para Vertical */
    .project-card {
        flex-direction: column !important;
        height: auto !important;
        min-height: unset !important;
    }

    .project-card .image-container {
        width: 100% !important;
        height: 200px !important;
        border-radius: 8px 8px 0 0 !important;
    }

    .project-card .image-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .project-card .card-content {
        width: 100% !important;
        padding: 15px !important;
        border-left: none !important;
    }

    /* 5. Corrigir Overflow em Containers Principais */
    html,
    body,
    .container,
    .main,
    .content,
    .page-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .main-content,
    .flex-container,
    .main-content-wrapper {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}