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

/* ==========================================================================
   1. TOKENS DE DESIGN - MATERIAL DESIGN 3 (M3)
   ========================================================================== */
:root {
    /* M3 Dynamic Green Palette (Sage / Forest Theme) */
    --md-sys-color-primary: #2b6a3f;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d2e8d4;
    --md-sys-color-on-primary-container: #0c2411;
    --md-sys-color-secondary: #4a6350;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #dce8d7;
    --md-sys-color-on-secondary-container: #1f2e21;
    
    /* M3 Neutral Colors */
    --md-sys-color-background: #f7f9f5;
    --md-sys-color-on-background: #1a1c19;
    --md-sys-color-surface: #ffffff;
    --md-sys-color-on-surface: #1a1c19;
    --md-sys-color-surface-variant: #f0f4ef;
    --md-sys-color-on-surface-variant: #434940;
    
    /* M3 Outlines */
    --md-sys-color-outline: #73796e;
    --md-sys-color-outline-variant: #c2c9bd;

    /* Semantic States (M3 Tonal Colors) */
    --success-color: #2e6c40;
    --success-light: #e8f5ec;
    --error-red: #ba1a1a;
    --error-background: #ffdad6;
    --blue-start: #005FAF;
    --blue-light: #d4e3ff;
    --warning-color: #7d5700;
    --warning-light: #ffe08c;
    --green-start: var(--md-sys-color-primary);
    --green-end: #1e4d2b;

    /* Legacy Map Variables to preserve existing class hooks */
    --brand-primary: var(--md-sys-color-primary);
    --brand-hover: #1e4d2b;
    --brand-light: var(--md-sys-color-primary-container);
    --brand-glow: rgba(43, 106, 63, 0.12);
    --primary-text: var(--md-sys-color-on-background);
    --secondary-text: var(--md-sys-color-on-surface-variant);
    --background-color: var(--md-sys-color-background);
    --card-background: var(--md-sys-color-surface);
    --border-color: var(--md-sys-color-outline-variant);

    /* M3 Elevation Shadow Levels */
    --md-sys-elevation-0: none;
    --md-sys-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.12);
    --md-sys-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.12);
    --md-sys-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.08), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);

    --shadow-sm: var(--md-sys-elevation-1);
    --shadow-md: var(--md-sys-elevation-2);
    --shadow-lg: var(--md-sys-elevation-3);

    /* M3 Shape Corners */
    --md-sys-shape-corner-xs: 4px;
    --md-sys-shape-corner-s: 8px;
    --md-sys-shape-corner-m: 12px;
    --md-sys-shape-corner-l: 16px;
    --md-sys-shape-corner-xl: 28px;
    --md-sys-shape-corner-full: 9999px;

    --radius-sm: var(--md-sys-shape-corner-s);
    --radius-md: var(--md-sys-shape-corner-m);
    --radius-lg: var(--md-sys-shape-corner-l);

    /* M3 Standard Easing Transitions */
    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-decelerated: cubic-bezier(0, 0, 0.2, 1);
    --transition-fast: 150ms var(--md-sys-motion-easing-standard);
    --transition-normal: 280ms var(--md-sys-motion-easing-standard);
}

/* ==========================================================================
   2. RESET & ESTILOS GLOBAIS
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Poppins', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.15px;
}

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

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   3. ESTRUTURA PRINCIPAL & M3 NAVIGATION DRAWER
   ========================================================================== */
.dashboard-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Sidebar refatorada como M3 Modal/Standard Navigation Drawer */
.sidebar {
    width: 280px;
    background-color: var(--md-sys-color-surface);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.sidebar-header {
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    overflow: hidden;
}

.sidebar-logo {
    max-height: 48px;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}

.logo-fallback {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--md-sys-color-primary);
}

.logo-fallback i {
    font-size: 1.65rem;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}
.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-outline-variant);
    border-radius: 4px;
}

.nav-list,
.nav-list li {
    list-style: none !important;
    list-style-type: none !important;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    letter-spacing: 0.8px;
    padding: 18px 16px 8px 16px;
}

/* Nav Link em formato pílula M3 */
.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--md-sys-shape-corner-full);
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
}

.nav-item.active > .nav-link {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 700;
}

.nav-icon {
    font-size: 1.35rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    color: inherit;
}

.nav-text {
    flex-grow: 1;
}

.arrow {
    font-size: 0.85rem;
    transition: transform var(--transition-normal);
    margin-left: auto;
}

.nav-item.open .arrow {
    transform: rotate(90deg);
}

.sub-menu,
.sub-menu li {
    list-style: none !important;
    list-style-type: none !important;
}

.sub-menu {
    padding: 4px 0 4px 16px;
    margin-top: 2px;
    display: none;
    position: relative;
}

.sub-menu::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--md-sys-color-outline-variant);
}

.nav-item.open .sub-menu {
    display: block;
    animation: slideDown var(--transition-normal);
}

.sub-menu li a {
    padding: 8px 16px 8px 32px;
    color: var(--md-sys-color-on-surface-variant);
    display: block;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--md-sys-shape-corner-full);
    position: relative;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sub-menu li a:hover {
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface-variant);
}

.sub-menu li.active a {
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
    font-weight: 700;
}

.bullet {
    display: none !important;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface);
}

.logout-item .nav-link {
    color: var(--error-red);
}

.logout-item .nav-link:hover {
    background-color: var(--error-background);
    color: var(--error-red);
}

/* Área de Conteúdo Principal */
.main-content {
    margin-left: 280px;
    padding: 36px 40px;
    width: calc(100% - 280px);
    max-width: calc(100% - 280px);
    flex-grow: 1;
    min-width: 0;
    transition: margin-left var(--transition-normal), width var(--transition-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 36px;
    animation: fadeInUp var(--transition-normal);
}

/* Cabeçalho do Conteúdo (Main Header) */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.header-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0; /* Permite que os filhos flexíveis encolham para truncamento */
}

.header-title-section > div {
    min-width: 0; /* Permite que o container de textos encolha */
}

.page-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--md-sys-color-on-background);
    letter-spacing: -0.5px;
    margin: 0; /* Remove margens do navegador */
    line-height: 1.2; /* Altura de linha ajustada */
}

.page-subtitle {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
    margin: 4px 0 0 0; /* Margem controlada em vez de default do navegador */
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Menu Hambúrguer Móvel */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu span {
    width: 100%;
    height: 2.5px;
    background-color: var(--md-sys-color-on-background);
    border-radius: 4px;
    transition: all var(--transition-normal);
}

/* Overlay Móvel */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 28, 25, 0.4);
    backdrop-filter: blur(8px);
    z-index: 998;
    animation: fadeIn var(--transition-fast);
}

/* Menu de Perfil / Dropdown */
.profile-wrapper {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: all var(--transition-fast);
    background-color: var(--md-sys-color-surface);
}

.user-profile:hover {
    background-color: var(--md-sys-color-surface-variant);
    transform: translateY(-1px);
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--md-sys-color-primary-container);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--md-sys-color-on-background);
}

.user-role {
    font-size: 0.78rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 1.1rem;
    color: var(--md-sys-color-outline);
    transition: transform var(--transition-fast);
}

.profile-wrapper.open .dropdown-arrow {
    transform: rotate(180deg);
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-l);
    box-shadow: var(--md-sys-elevation-2);
    border: 1px solid var(--md-sys-color-outline-variant);
    z-index: 1000;
    min-width: 220px;
    padding: 8px;
    animation: scaleUp var(--transition-fast) forwards;
    transform-origin: top right;
}

.profile-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--md-sys-shape-corner-full);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.dropdown-item i {
    font-size: 1.25rem;
    color: var(--md-sys-color-outline);
}

.dropdown-item.logout {
    color: var(--error-red);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    margin-top: 6px;
    padding-top: 12px;
    border-radius: 0;
}

.dropdown-item.logout i {
    color: var(--error-red);
}

/* ==========================================================================
   4. COMPONENTES DE INTERFACE M3 (CARDS, BOTÕES, FORMULÁRIOS)
   ========================================================================== */

/* Cards M3 Elevados e Suaves */
.card, .card-modern {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-l);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 28px;
    box-shadow: var(--md-sys-elevation-1);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 0;
}

.card:hover, .card-modern:hover {
    box-shadow: var(--md-sys-elevation-2);
}

/* Botões M3 (Filled, Outlined, Text) */
.btn-primary, .btn-secondary, .btn-danger, .btn-success {
    padding: 12px 24px;
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    outline: none;
}

.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-0);
}

.btn-primary:hover {
    background-color: var(--brand-hover);
    box-shadow: var(--md-sys-elevation-1);
}

.btn-secondary {
    background-color: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-primary);
}

.btn-secondary:hover {
    background-color: var(--md-sys-color-surface-variant);
    border-color: var(--md-sys-color-primary);
}

.btn-danger {
    background-color: var(--error-red);
    color: white;
}

.btn-danger:hover {
    background-color: #a01010;
    box-shadow: var(--md-sys-elevation-1);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #215130;
    box-shadow: var(--md-sys-elevation-1);
}

/* Formulários M3 Outlined */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 28px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    padding-left: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-s);
    font-size: 0.95rem;
    font-family: inherit;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: var(--md-sys-color-surface-variant);
    border-color: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-outline);
    cursor: not-allowed;
}

.form-actions-main {
    border-top: 1px solid var(--md-sys-color-outline-variant);
    margin-top: 36px;
    padding-top: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.form-actions-main .btn-danger {
    margin-left: auto;
}

/* Tabelas M3 */
.table-wrapper,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper {
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-m);
    background-color: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-0);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

th {
    background-color: var(--md-sys-color-surface-variant);
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background-color var(--transition-fast);
}

tbody tr:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.action-btn {
    text-decoration: none;
    color: var(--blue-start);
    font-weight: 700;
    transition: color var(--transition-fast);
}

.action-btn:hover {
    color: #003666;
}

.action-btn-delete {
    background: none;
    border: none;
    color: var(--error-red);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.action-btn-delete:hover {
    color: #7a1010;
}

/* Badges de Status Modernos (M3 Tonal Badges) */
.status-badge {
    border-radius: var(--md-sys-shape-corner-full);
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-ativa, .status-ativo, .status-concluida, .status-realizada, .status-aprovada, .status-concluída {
    background-color: var(--success-light);
    color: var(--success-color);
}

.status-inativa, .status-suspensa, .status-inativo, .status-nao-iniciada, .status-cancelada, .status-em-elaboracao, .status-rejeitada, .status-pausado {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
}

.status-agendada, .status-em-andamento {
    background-color: var(--blue-light);
    color: var(--blue-start);
}

.status-atrasada, .status-atrasado, .status-aguardando-aprovação {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

/* Alertas e Notificações */
.success-message, .error-message, .message-box {
    padding: 16px 20px;
    border-radius: var(--md-sys-shape-corner-m);
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.success-message, .msg-success {
    background-color: var(--success-light);
    color: var(--success-color);
    border-color: rgba(46, 108, 64, 0.2);
}

.error-message {
    background-color: var(--error-background);
    color: var(--error-red);
    border-color: rgba(186, 26, 26, 0.2);
}

/* Modais Dinâmicos */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 28, 25, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background-color: var(--md-sys-color-surface);
    padding: 36px;
    border-radius: var(--md-sys-shape-corner-xl);
    width: 90%;
    max-width: 460px;
    text-align: center;
    box-shadow: var(--md-sys-elevation-3);
    transform: scale(0.92);
    transition: transform var(--transition-normal);
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

.modal-icon {
    font-size: 3.5rem;
    color: var(--error-red);
    margin-bottom: 18px;
}

.modal-box h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
    color: var(--md-sys-color-on-background);
    font-weight: 800;
}

.modal-box p {
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.modal-actions button {
    padding: 12px 24px;
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.modal-confirm-btn {
    background-color: var(--error-red);
    color: white;
}

.modal-confirm-btn:hover {
    background-color: #a01010;
}

.modal-cancel-btn {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-outline);
}

.modal-cancel-btn:hover {
    background-color: var(--md-sys-color-surface-variant);
}

/* Abas de Navegação (Tabs) */
.tabs-nav {
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    margin-bottom: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tab-link {
    background: none;
    border: none;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    outline: none;
}

.tab-link:hover {
    color: var(--md-sys-color-on-surface);
}

.tab-link.active {
    color: var(--md-sys-color-primary);
    border-bottom-color: var(--md-sys-color-primary);
}

.tab-link:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -4px;
    border-radius: var(--md-sys-shape-corner-s);
}

.tab-content {
    display: none;
    animation: fadeIn var(--transition-normal);
}

/* Comentários */
.comment-form-box {
    background-color: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 24px;
    border-radius: var(--md-sys-shape-corner-l);
    margin-bottom: 28px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.comment-author-pic img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--md-sys-color-primary-container);
}

.comment-content {
    flex-grow: 1;
    background-color: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-l);
    padding: 20px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    padding-bottom: 10px;
}

.comment-header strong {
    font-size: 0.95rem;
    color: var(--md-sys-color-on-background);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--md-sys-color-on-surface-variant);
}

.comment-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--md-sys-color-on-surface);
}

/* ==========================================================================
   5. COMPONENTES E PÁGINAS ESPECÍFICAS
   ========================================================================== */

/* LOGIN M3 STYLE */
.login-body-light {
    min-height: 100vh;
    display: flex;
    background: var(--md-sys-color-background);
    overflow: hidden;
    position: relative;
}

.login-left-panel {
    flex: 12;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(16, 49, 29, 0.9) 0%, rgba(30, 77, 43, 0.9) 100%), url('../img/sistema/login_bg.png') no-repeat center center;
    background-size: cover;
    z-index: 1;
}

.login-left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.login-left-panel::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(210, 232, 212, 0.15) 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
    z-index: 0;
}

.login-panel-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-panel-brand-logo {
    max-height: 48px;
    filter: brightness(0) invert(1);
}

.login-panel-brand-name {
    font-size: 1.7rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.login-panel-hero {
    position: relative;
    z-index: 1;
}

.login-panel-hero h2 {
    font-size: 2.85rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    letter-spacing: -1px;
    margin-bottom: 24px;
}

.login-panel-hero h2 span {
    color: var(--md-sys-color-primary-container);
}

.login-panel-hero p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    max-width: 380px;
}

.login-panel-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 600;
}

.login-feature-item i {
    width: 36px;
    height: 36px;
    border-radius: var(--md-sys-shape-corner-s);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* Painel Direito (M3 Form Card) */
.login-right-panel {
    width: 500px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--md-sys-color-surface);
    position: relative;
    z-index: 2;
    overflow-y: auto;
    border-left: 1px solid var(--md-sys-color-outline-variant);
}

.login-form-box {
    width: 100%;
    max-width: 360px;
    animation: loginSlideIn 0.45s var(--md-sys-motion-easing-standard) both;
}

@keyframes loginSlideIn {
    from { opacity: 0; transform: translateX(36px); }
    to   { opacity: 1; transform: translateX(0); }
}

.login-form-header {
    margin-bottom: 32px;
}

.login-form-greeting {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--md-sys-color-primary);
    margin-bottom: 8px;
}

.login-form-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--md-sys-color-on-background);
    letter-spacing: -0.75px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.login-form-subtitle {
    font-size: 0.95rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 8px;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap .login-input-icon,
.login-input-wrap .login-input-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-sys-color-outline);
    font-size: 1.25rem;
    z-index: 2;
    transition: color var(--transition-fast);
}

.login-input-wrap .login-input-icon {
    left: 16px;
    pointer-events: none;
}

.login-input-wrap .login-input-toggle {
    right: 16px;
    cursor: pointer;
}

.login-input-wrap .login-input-toggle:hover {
    color: var(--md-sys-color-on-surface);
}

.login-input-ctrl {
    width: 100%;
    height: 52px;
    padding: 0 48px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-s);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: all var(--transition-fast);
    outline: none;
}

.login-input-ctrl:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.login-input-ctrl:focus + .login-input-icon,
.login-input-wrap:focus-within .login-input-icon {
    color: var(--md-sys-color-primary);
}

.login-error-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--error-background);
    color: var(--error-red);
    border: 1px solid rgba(186, 26, 26, 0.2);
    border-left: 4px solid var(--error-red);
    border-radius: var(--md-sys-shape-corner-s);
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 24px;
    animation: slideDown 0.25s ease both;
}

.login-form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 32px;
    margin-top: -8px;
}

.login-forgot-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    text-decoration: none;
}

.login-forgot-link:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

.login-submit-btn {
    width: 100%;
    height: 52px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    box-shadow: var(--md-sys-elevation-1);
}

.login-submit-btn:hover {
    background-color: var(--brand-hover);
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-1px);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 0;
    color: var(--md-sys-color-outline);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--md-sys-color-outline-variant);
}

.login-form-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
}

@media (max-width: 992px) {
    .login-left-panel {
        display: none;
    }
    .login-right-panel {
        width: 100%;
        min-height: 100vh;
        border-left: none;
    }
}

/* Legado Fallback */
.login-wrapper-light {
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.login-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-l);
    padding: 44px 36px;
    box-shadow: var(--md-sys-elevation-2);
    border: 1px solid var(--md-sys-color-outline-variant);
    width: 100%;
    display: flex;
    flex-direction: column;
}

.login-card .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.login-card .logo .login-logo-img {
    max-height: 52px;
}

.login-card .title {
    font-size: 1.65rem;
    font-weight: 800;
    text-align: center;
    color: var(--md-sys-color-on-background);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.login-card .subtitle {
    font-size: 0.95rem;
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
    margin-bottom: 32px;
}

.login-card .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.login-card .forgot-password {
    font-size: 0.85rem;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    font-weight: 700;
}

.login-card .forgot-password:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

/* Floating Label Estilizado M3 Outlined */
.form-floating-group {
    position: relative;
    margin-bottom: 20px;
}

.form-floating-group .form-control {
    width: 100%;
    height: 54px;
    padding: 20px 16px 6px 44px;
    font-size: 0.95rem;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-s);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.form-floating-group label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 15px 44px;
    font-size: 0.95rem;
    color: var(--md-sys-color-outline);
    pointer-events: none;
    transform-origin: 0 0;
    transition: all var(--transition-fast);
}

.form-floating-group .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-sys-color-outline);
    font-size: 1.3rem;
    z-index: 2;
}

.form-floating-group .icon-toggle {
    left: auto;
    right: 16px;
    cursor: pointer;
}

.form-floating-group .form-control:focus ~ label,
.form-floating-group .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.75) translateY(-10px) translateX(-6px);
    color: var(--md-sys-color-primary);
    font-weight: 700;
}

.form-floating-group .form-control:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Dashboard Grid & Widgets */
.dashboard-grid {
    display: grid;
    gap: 28px;
    width: 100%;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

/* KPI Card Modernizado */
.kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    cursor: pointer;
}

.kpi-card:hover {
    box-shadow: var(--md-sys-elevation-2);
}

.kpi-card .icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--md-sys-shape-corner-m);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 1.35rem;
}

.kpi-card .icon-wrapper.green {
    background-color: var(--success-light);
    color: var(--success-color);
}

.kpi-card .icon-wrapper.blue {
    background-color: var(--blue-light);
    color: var(--blue-start);
}

.kpi-card .icon-wrapper.yellow {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.kpi-card .icon-wrapper.red {
    background-color: var(--error-background);
    color: var(--error-red);
}

.kpi-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.kpi-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--md-sys-color-on-background);
    margin-top: 4px;
    letter-spacing: -0.5px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}

.swot-table {
    margin-top: 16px;
    width: 100%;
    border: none;
}

.progress-bar-bg {
    background-color: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-full);
    height: 12px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-full);
    transition: width 0.4s ease;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.config-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    width: 100%;
    background-color: var(--md-sys-color-surface-variant);
    border: 2px dashed var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-m);
    margin-bottom: 8px;
    padding: 12px;
}

.image-preview img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.image-preview span {
    color: var(--md-sys-color-outline);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Portais Públicos */
.public-container {
    max-width: 700px;
    margin: 48px auto;
    padding: 0 20px;
    animation: fadeInUp var(--transition-normal);
}

.public-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--md-sys-color-on-background);
    text-decoration: none;
}

.public-logo i {
    font-size: 2rem;
    color: var(--md-sys-color-primary);
}

.public-header {
    text-align: center;
    margin-bottom: 32px;
}

.public-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--md-sys-color-primary);
}

.public-header p {
    font-size: 0.95rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 6px;
}

.public-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-l);
    padding: 36px;
    box-shadow: var(--md-sys-elevation-2);
    border: 1px solid var(--md-sys-color-outline-variant);
}

/* Filtros M3 style */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background-color: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-m);
    border: 1px solid var(--md-sys-color-outline-variant);
    margin-bottom: 28px;
}

.filter-form input[type="text"],
.filter-form select,
.filter-form input[type="date"] {
    padding: 10px 14px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-s);
    font-size: 0.9rem;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    outline: none;
    transition: all var(--transition-fast);
}

.filter-form input[type="text"]:focus,
.filter-form select:focus,
.filter-form input[type="date"]:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px var(--brand-glow);
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.pagination {
    display: flex;
    list-style: none;
    border-radius: var(--md-sys-shape-corner-full);
    overflow: hidden;
    border: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface);
}

.page-link {
    display: block;
    padding: 10px 18px;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    border-left: 1px solid var(--md-sys-color-outline-variant);
    font-size: 0.9rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.page-item:first-child .page-link {
    border-left: none;
}

.page-link:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.page-item.active .page-link {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.page-item.disabled .page-link {
    color: var(--md-sys-color-outline);
    pointer-events: none;
    background-color: var(--md-sys-color-surface-variant);
}

/* Preloader M3 Style */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--md-sys-color-background);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

body.loaded #preloader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
    text-align: center;
}

.preloader-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: preloaderPulse 2.2s ease-in-out infinite;
}

.preloader-logo {
    max-height: 70px;
    width: auto;
}

.preloader-logo-fallback {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--md-sys-color-primary);
    font-family: 'Poppins', sans-serif;
}

.preloader-logo-fallback i {
    font-size: 2.85rem;
}

.preloader-progress-bar-wrapper {
    width: 200px;
    height: 4px;
    background-color: var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.1));
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin-top: 8px;
}

.preloader-progress-bar {
    width: 100%;
    height: 100%;
    background-color: var(--md-sys-color-primary, #2b6a3f);
    transform-origin: 0% 50%;
    animation: preloaderIndeterminate 1.5s infinite linear;
}

@keyframes preloaderIndeterminate {
    0% {
        transform: translateX(-100%) scaleX(0.1);
    }
    30% {
        transform: translateX(-50%) scaleX(0.4);
    }
    60% {
        transform: translateX(0%) scaleX(0.6);
    }
    100% {
        transform: translateX(100%) scaleX(0.1);
    }
}

@keyframes preloaderPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.03);
        opacity: 0.92;
    }
}

/* ==========================================================================
   6. RESPONSIVIDADE E DISPOSITIVOS MÓVEIS (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--md-sys-elevation-3);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-header {
        padding: 20px 24px 16px 24px; /* Aumenta a margem superior/vertical no cabeçalho do menu lateral */
        height: auto;
        min-height: 76px;
    }

    .main-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px; /* Reduzido de 64px */
        background-color: var(--md-sys-color-surface);
        border-bottom: 1px solid var(--md-sys-color-outline-variant);
        box-shadow: var(--md-sys-elevation-1);
        padding: 0 16px; /* Reduzido de 20px */
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 990;
    }

    .hamburger-menu {
        display: flex;
        margin-right: 8px; /* Reduzido de 12px */
    }

    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }

    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 76px 16px 20px 16px; /* Reduzido de 92px top e 24px bottom */
    }

    .page-subtitle, .user-info, .dropdown-arrow {
        display: none;
    }

    .user-profile {
        padding: 4px; /* Reduzido de 6px */
        border: none;
    }
    
    .user-profile:hover {
        background-color: transparent;
    }

    .dashboard-grid.grid-4, .bi-grid {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    /* Ajuste de Preloader Logo no Mobile */
    .preloader-logo {
        max-height: 24px; /* Reduzido para 24px */
        max-width: 100px; /* Limita a largura do logo para não esticar */
        height: auto;
        width: auto;
        object-fit: contain;
    }
    .preloader-logo-fallback {
        font-size: 1.25rem; /* Reduzido para 1.25rem */
    }
    .preloader-logo-fallback i {
        font-size: 1.5rem; /* Reduzido para 1.5rem */
    }

    .page-title {
        font-size: 1.3rem; /* Reduzido de 1.85rem */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
}

@media (max-width: 768px) {
    .main-header {
        gap: 12px; /* Reduzido de 16px */
        padding: 0 12px;
    }

    .page-title {
        font-size: 1.15rem; /* Ajustado para telas pequenas */
        max-width: 190px; /* Evita sobreposição com ícones da direita */
    }

    .main-content {
        padding: 76px 12px 20px 12px; /* Espaçamento lateral reduzido para mobile fino */
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions-main {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions-main .btn-danger {
        margin-left: 0;
        margin-top: 8px;
    }

    .public-card {
        padding: 24px;
    }
}

/* ==========================================================================
   7. CLASSES UTILITÁRIAS
   ========================================================================== */
.position-relative {
    position: relative !important;
}
.position-absolute {
    position: absolute !important;
}
.top-50 {
    top: 50% !important;
}
.start-0 {
    left: 0 !important;
}
.translate-middle-y {
    transform: translateY(-50%) !important;
}
.ms-3 {
    margin-left: 1rem !important;
}
.ps-5 {
    padding-left: 3rem !important;
}

/* Ícones nos Inputs */
.input-icon-wrapper-modern {
    position: relative;
    width: 100%;
}

.input-icon-wrapper-modern .icon-input {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-sys-color-outline);
    font-size: 1.15rem;
    pointer-events: none;
    z-index: 5;
    transition: color var(--transition-fast);
}

.modern-input-with-icon {
    padding-left: 44px !important;
}

.input-icon-wrapper-modern:focus-within .icon-input {
    color: var(--md-sys-color-primary);
}

.input-icon-wrapper-modern .select2-container .select2-selection--single,
.input-icon-wrapper-modern .select2-container .select2-selection--multiple {
    padding-left: 36px !important;
}

#tabelaMetasCorpo {
    transition: opacity var(--transition-fast);
}

/* Flexbox and Layout Utilities */
.d-flex { display: flex !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.h-100 { height: 100% !important; }
.w-100 { width: 100% !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.8rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.bg-white { background-color: #fff !important; }
.bg-light { background-color: var(--md-sys-color-surface-variant) !important; }
.border { border: 1px solid var(--md-sys-color-outline-variant) !important; }
.rounded { border-radius: var(--md-sys-shape-corner-m) !important; }
.rounded-3 { border-radius: var(--md-sys-shape-corner-l) !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--md-sys-color-on-surface-variant) !important; }
.text-success { color: var(--md-sys-color-primary) !important; }

/* Custom styles for upload container & empty table state */
.tab-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--md-sys-color-on-background);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-title i {
    color: var(--md-sys-color-primary);
    font-size: 1.4rem;
}

.upload-container {
    background-color: var(--md-sys-color-surface-variant);
    border: 2px dashed var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-m);
    padding: 20px 24px;
    margin-bottom: 28px;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.upload-container:hover {
    border-color: var(--md-sys-color-primary);
    background-color: rgba(43, 106, 63, 0.03);
}

.upload-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.upload-drop-zone {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
    min-width: 280px;
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    padding: 10px 18px;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--md-sys-color-primary);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.file-input-label:hover {
    background-color: var(--md-sys-color-surface-variant);
    border-color: var(--md-sys-color-primary);
}

.file-input-label i {
    font-size: 1.15rem;
}

.selected-file-name {
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 450px;
}

.selected-file-name.selected {
    color: var(--md-sys-color-on-background);
    font-weight: 600;
}

.empty-table-state {
    text-align: center;
    padding: 48px 24px !important;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-table-state i {
    font-size: 2.5rem;
    color: var(--md-sys-color-outline-variant);
    margin-bottom: 12px;
    display: block;
}

.empty-table-state p {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
}

@media (max-width: 768px) {
    .upload-form {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .upload-drop-zone {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .selected-file-name {
        max-width: 100%;
    }
}

/* ==========================================================================
   Custom Lightweight Grid System (Bootstrap-compatible)
   ========================================================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
    margin-left: -12px;
}

.row > [class*="col-"] {
    box-sizing: border-box;
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
    margin-bottom: 24px; /* Gutter vertical essencial */
}

/* Colunas padrão e gutter vertical no wrap */
.row.g-4 > [class*="col-"] {
    padding-right: 16px;
    padding-left: 16px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Telas médias (MD - tablets) */
@media (min-width: 768px) {
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Telas grandes (LG - desktops) */
@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    .col-lg-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }
    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Telas extra grandes (XXL - ultra-wide) */
@media (min-width: 1400px) {
    .col-xxl-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* Custom list header styling */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.list-header h3 {
    margin-bottom: 0 !important;
}

.card h3, .card-modern h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--md-sys-color-on-background);
    margin-bottom: 20px;
}

/* ==========================================================================
   23. EDITOR RICH TEXT NATIVO (Material Design 3)
   ========================================================================== */
.native-rich-editor {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-m);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.native-rich-editor:focus-within {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.native-rich-editor.readonly {
    background-color: var(--md-sys-color-surface-variant);
    border-color: var(--md-sys-color-outline-variant);
}

.native-rich-editor.readonly:focus-within {
    border-color: var(--md-sys-color-outline-variant);
    box-shadow: none;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--md-sys-color-surface-variant);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.editor-btn-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.editor-divider {
    width: 1px;
    height: 20px;
    background-color: var(--md-sys-color-outline-variant);
    margin: 0 4px;
}

.editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: var(--md-sys-shape-corner-s);
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.editor-btn:hover {
    background-color: rgba(43, 106, 63, 0.08);
    color: var(--md-sys-color-primary);
}

.editor-btn.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-weight: bold;
}

.editor-content {
    min-height: 320px;
    padding: 16px;
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--md-sys-color-on-background);
    overflow-y: auto;
    line-height: 1.6;
}

.editor-content[contenteditable="false"] {
    cursor: not-allowed;
    background-color: #fafbf9;
}

/* Typography styles inside editor content */
.editor-content p {
    margin-bottom: 12px;
}

.editor-content p:last-child {
    margin-bottom: 0;
}

.editor-content ul, 
.editor-content ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.editor-content li {
    margin-bottom: 4px;
}

.editor-content blockquote {
    border-left: 4px solid var(--md-sys-color-primary);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--md-sys-color-on-surface-variant);
    font-style: italic;
}

/* ==========================================================================
   24. CENTRO DE NOTIFICAÇÕES (Material Design 3)
   ========================================================================== */
.notifications-wrapper {
    position: relative;
    margin-right: 16px;
    display: inline-flex;
    align-items: center;
}

.notifications-bell {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: var(--md-sys-shape-corner-full);
    color: var(--md-sys-color-on-background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.notifications-bell:hover {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-primary);
}

.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--error-red);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--md-sys-color-surface);
    box-shadow: var(--shadow-sm);
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-m);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transform-origin: top right;
    animation: dropdownFadeIn var(--transition-fast);
}

.notifications-dropdown.show {
    display: flex;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface);
}

.notifications-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--md-sys-color-on-background);
}

.mark-all-read {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--md-sys-shape-corner-xs);
    transition: background-color var(--transition-fast);
}

.mark-all-read:hover {
    background-color: var(--md-sys-color-primary-container);
}

.notifications-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
}

.notifications-empty i {
    font-size: 2.2rem;
    margin-bottom: 8px;
    opacity: 0.5;
    color: var(--md-sys-color-outline);
}

.notifications-empty p {
    font-size: 0.85rem;
    margin: 0;
}

.notifications-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    text-decoration: none;
    color: var(--md-sys-color-on-background);
    transition: background-color var(--transition-fast);
    cursor: pointer;
}

.notifications-item:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.notifications-item.unread {
    background-color: rgba(43, 106, 63, 0.04);
}

.notifications-item.unread:hover {
    background-color: rgba(43, 106, 63, 0.08);
}

.notifications-icon-container {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
}

.notifications-item.unread .notifications-icon-container {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
}

.notifications-item.danger .notifications-icon-container {
    background-color: var(--error-background);
    color: var(--error-red);
}

.notifications-item.warning .notifications-icon-container {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.notifications-item.success .notifications-icon-container {
    background-color: var(--success-light);
    color: var(--success-color);
}

.notifications-content {
    flex-grow: 1;
}

.notifications-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--md-sys-color-on-background);
    line-height: 1.3;
}

.notifications-item.unread .notifications-title {
    font-weight: 700;
}

.notifications-text {
    font-size: 0.8rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 4px;
    line-height: 1.4;
}

.notifications-time {
    font-size: 0.7rem;
    color: var(--md-sys-color-outline);
}

.notifications-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface-variant);
}

.notifications-footer a {
    text-decoration: none;
    font-size: 0.8rem;
    color: var(--md-sys-color-primary);
    font-weight: 700;
    transition: color var(--transition-fast);
}

.notifications-footer a:hover {
    color: var(--brand-hover);
}

/* ==========================================================================
   PÁGINA DO CENTRO DE NOTIFICAÇÕES
   ========================================================================== */
.notifications-list-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 24px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-m);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.notification-card.unread {
    border-left: 4px solid var(--md-sys-color-primary);
    background-color: rgba(43, 106, 63, 0.02);
}

.notification-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--md-sys-color-primary);
}

.notification-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
}

.notification-card.unread .notification-card-icon {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
}

.notification-card.danger .notification-card-icon {
    background-color: var(--error-background);
    color: var(--error-red);
}

.notification-card.warning .notification-card-icon {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.notification-card.success .notification-card-icon {
    background-color: var(--success-light);
    color: var(--success-color);
}

.notification-card-body {
    flex-grow: 1;
}

.notification-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.notification-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--md-sys-color-on-background);
}

.notification-card.unread .notification-card-title {
    font-weight: 700;
}

.notification-card-time {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline);
}

.notification-card-desc {
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.notification-card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.notification-card-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--md-sys-shape-corner-s);
    background-color: var(--md-sys-color-primary-container);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.notification-card-btn-action:hover {
    background-color: var(--brand-primary);
    color: #ffffff;
}

.notification-card-btn-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--md-sys-color-outline);
    border: 1px solid var(--md-sys-color-outline-variant);
    background: none;
    padding: 5px 12px;
    border-radius: var(--md-sys-shape-corner-s);
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.notification-card-btn-read:hover {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
}


