/* css/header.css */
:root {
    --primary: #2D7D46;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary: #607D8B;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #adb5bd;
    --dark: #343a40;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
    --radius: 0.5rem;

    /* Dark Mode Variables */
    --dark-mode-bg: #1a1a1a;
    --dark-mode-text: #e0e0e0;
    --dark-mode-card-bg: #2c2c2c;
    --dark-mode-border: #444;
    --dark-mode-link: #90caf9;
    --dark-mode-link-hover: #bbdefb;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7f9;
    color: var(--dark);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    background-color: var(--dark-mode-bg);
    color: var(--dark-mode-text);
}
body.dark-mode a { color: var(--dark-mode-link); }
body.dark-mode a:hover { color: var(--dark-mode-link-hover); }
body.dark-mode .top-bar,
body.dark-mode .main-header,
body.dark-mode .navbar-custom,
body.dark-mode .dropdown-menu,
body.dark-mode .profile-menu,
body.dark-mode .notification-menu,
body.dark-mode .sistemas-dropdown-menu {
    background-color: var(--dark-mode-card-bg) !important;
    color: var(--dark-mode-text) !important;
    border-color: var(--dark-mode-border) !important;
}
body.dark-mode .top-bar a,
body.dark-mode .navbar-custom .navbar-nav .nav-link,
body.dark-mode .dropdown-item,
body.dark-mode .profile-menu .dropdown-item,
body.dark-mode .notification-menu .dropdown-item,
body.dark-mode .sistemas-dropdown-menu .dropdown-item {
    color: var(--dark-mode-text) !important;
}
body.dark-mode .top-bar a:hover,
body.dark-mode .navbar-custom .navbar-nav .nav-link:hover,
body.dark-mode .dropdown-item:hover,
body.dark-mode .profile-menu .dropdown-item:hover,
body.dark-mode .notification-menu .dropdown-item:hover,
body.dark-mode .sistemas-dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--dark-mode-link-hover) !important;
}
body.dark-mode .dropdown-divider { border-top-color: var(--dark-mode-border) !important; }
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: var(--dark-mode-card-bg);
    color: var(--dark-mode-text);
    border-color: var(--dark-mode-border);
}
body.dark-mode .form-control::placeholder { color: var(--gray-500); }
body.dark-mode .btn-primary,
body.dark-mode .btn-success,
body.dark-mode .btn-danger { color: var(--white) !important; }
body.dark-mode .btn-outline-secondary {
    color: var(--dark-mode-text) !important;
    border-color: var(--dark-mode-border) !important;
}
body.dark-mode .btn-outline-secondary:hover { background-color: rgba(255, 255, 255, 0.1) !important; }
body.dark-mode .user-avatar {
    background-color: var(--dark-mode-text) !important;
    color: var(--dark-mode-bg) !important;
}
body.dark-mode .notification-badge .badge { color: var(--white) !important; }
body.dark-mode .notification-item { border-bottom-color: var(--dark-mode-border) !important; }
body.dark-mode .notification-name,
body.dark-mode .notification-content span { color: var(--dark-mode-text) !important; }
body.dark-mode .notification-time { color: var(--gray-500) !important; }
body.dark-mode .sistemas-badge,
body.dark-mode .badge-secure,
body.dark-mode .badge-admin {
    background-color: var(--dark-mode-border) !important;
    color: var(--dark-mode-text) !important;
}
body.dark-mode .navbar-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(224, 224, 224, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Header styling */
.top-bar {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-bar a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.top-bar a:hover { color: var(--gray-200); }

.top-bar .user-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.top-bar .user-avatar {
    width: 28px;
    height: 28px;
    background-color: var(--white);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 14px;
    font-weight: 600;
}

.top-bar .logout-btn {
    margin-left: 16px;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.top-bar .logout-btn:hover { background-color: rgba(255, 255, 255, 0.25); }

.main-header {
    background-color: var(--white);
    padding: 15px 0;
    box-shadow: var(--box-shadow);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo-container img {
    max-height: 70px;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(18, 54, 31, 0.16);
    transition: var(--transition);
}

.logo-container img:hover { transform: scale(1.05); }

.title-container h2 {
    color: var(--primary);
    font-weight: 600;
    margin: 0;
    font-size: 1.8rem;
}

/* Navbar styling */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.navbar-custom .navbar-nav {
    font-size: 90%;
}
/* Mantenha o menu em uma linha em telas largas; abaixo de 992px o Bootstrap recolhe o menu. */
@media (min-width: 992px) {
    .navbar-custom .navbar-collapse { flex-wrap: nowrap; }
    .navbar-custom .navbar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        width: 100%;
    }
    .navbar-custom .navbar-nav .nav-item { flex: 0 0 auto; }
    .navbar-custom .navbar-nav .nav-link {
        white-space: nowrap;
        padding: 15px clamp(6px, .75vw, 12px);
        font-size: clamp(.72rem, .82vw, .9rem);
    }
}
.navbar-custom .navbar-nav .nav-link {
    color: var(--white);
    padding: 15px;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.navbar-custom .navbar-nav .nav-link:hover,
.navbar-custom .navbar-nav .nav-link:focus {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-custom .navbar-nav .nav-link.active { background-color: rgba(255, 255, 255, 0.15); }

.navbar-custom .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--white);
    transition: var(--transition);
    transform: translateX(-50%);
}

.navbar-custom .navbar-nav .nav-link:hover::after,
.navbar-custom .navbar-nav .nav-link.active::after { width: 80%; }

.navbar-custom .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

.navbar-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 10px;
    margin-top: 5px;
    animation: fadeIn 0.3s ease;
    z-index: 1050;
}

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

.dropdown-item {
    padding: 8px 15px;
    color: var(--dark);
    border-radius: 4px;
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(45, 125, 70, 0.1);
    color: var(--primary);
}

.dropdown-item i {
    margin-right: 8px;
    color: var(--primary);
}

.dropdown-divider {
    margin: 5px 0;
    border-top-color: var(--gray-200);
}

/* Sistemas menu */
.sistemas-dropdown-menu {
    width: 300px;
    padding: 0;
    max-height: none;
    overflow-y: visible;
}

.sistemas-dropdown-menu .dropdown-header {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 14px;
}

.sistemas-badge {
    background-color: var(--primary-light);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

.sistemas-dropdown-menu .dropdown-item {
    padding: 8px 15px;
    white-space: normal;
    font-size: 14px;
}

.sistemas-dropdown-menu .dropdown-item i {
    margin-right: 8px;
    color: var(--primary);
}

.sistemas-dropdown-menu .view-all {
    text-align: center;
    font-weight: 500;
    padding: 10px 15px;
    color: var(--primary) !important;
    background-color: rgba(45, 125, 70, 0.05);
}

.sistemas-dropdown-menu .view-all:hover {
    background-color: rgba(45, 125, 70, 0.1) !important;
    color: var(--primary-dark) !important;
}

/* Badges de segurança */
.badge-secure {
    background-color: #E9F7EF;
    color: var(--primary-dark);
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.badge-secure i { font-size: 14px; margin-right: 5px; }

.badge-admin {
    background-color: #FFF3CD;
    color: #856404;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.badge-admin i { font-size: 14px; margin-right: 5px; }

/* Notificações */
.notification-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    margin-right: 5px;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    padding: 5px;
}

.notification-badge:hover {
    color: var(--warning);
    transform: scale(1.1);
}

.notification-badge i { font-size: 18px; }

.notification-badge .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--danger);
    color: white;
    border-radius: 50%;
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.notification-dropdown { position: relative; }

.notification-menu {
    width: 350px;
    max-height: 450px;
    overflow-y: auto;
    padding: 0;
    margin-top: 10px !important;
}

.notification-menu .dropdown-header {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 14px;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.notification-item:hover {
    background-color: rgba(45, 125, 70, 0.05);
    transform: translateX(5px);
}

.notification-item:active {
    background-color: rgba(45, 125, 70, 0.1);
    transform: scale(0.98);
}

.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-item:hover::before { opacity: 1; }

.notification-item.lida {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

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

.notification-user i {
    font-size: 16px;
    color: var(--primary);
}

.notification-name {
    font-weight: 500;
    color: var(--dark);
}

.notification-content {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--gray-500);
    padding-left: 26px;
}

.notification-time {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 5px;
}

.notification-time i { font-size: 11px; }

.view-all {
    text-align: center;
    font-weight: 500;
    padding: 12px;
    color: var(--primary) !important;
    background-color: rgba(45, 125, 70, 0.05);
}

.view-all:hover {
    background-color: rgba(45, 125, 70, 0.1) !important;
    color: var(--primary-dark) !important;
}

@keyframes pulse-notification {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 5px rgba(220, 53, 69, 0);
    }
}

.notification-badge .badge { animation: pulse-notification 2s infinite; }
.notification-dropdown.show .notification-badge .badge { animation: none; }

/* Menu de Acessibilidade */
.a11y-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.a11y-tools {
    display: flex;
    gap: 5px;
}

.a11y-btn-sm {
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--white);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.a11y-btn-sm:hover, .a11y-btn-sm:focus { background-color: rgba(255, 255, 255, 0.25); }
.a11y-btn-sm i { font-size: 14px; }
.a11y-text { display: inline-block; }

/* Alto Contraste */
.high-contrast-mode {
    background-color: #000 !important;
    color: #fff !important;
}
.high-contrast-mode a { color: #ffff00 !important; }
.high-contrast-mode .navbar-custom,
.high-contrast-mode .top-bar,
.high-contrast-mode .main-header,
.high-contrast-mode .card,
.high-contrast-mode .dropdown-menu {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #fff !important;
}
.high-contrast-mode .card,
.high-contrast-mode .dropdown-menu,
.high-contrast-mode .alert { border: 2px solid #fff !important; }
.high-contrast-mode button,
.high-contrast-mode .btn {
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}
.high-contrast-mode .btn:hover,
.high-contrast-mode button:hover { background-color: #333 !important; }
.high-contrast-mode input,
.high-contrast-mode select,
.high-contrast-mode textarea {
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

/* Dropdown de Perfil */
.profile-dropdown { position: relative; }
.user-profile {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--white);
    transition: var(--transition);
    padding: 4px 10px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.05);
}
.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
}
.profile-menu {
    min-width: 200px;
    padding: 5px;
    margin-top: 10px !important;
    right: 0;
    left: auto;
    background-color: var(--white);
}
.profile-menu .dropdown-item {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: var(--transition);
    color: var(--dark);
}
.profile-menu .dropdown-item i {
    margin-right: 10px;
    font-size: 16px;
    color: var(--primary);
}
.profile-menu .dropdown-item:hover {
    background-color: rgba(45, 125, 70, 0.1);
    color: var(--primary);
}
.profile-menu .dropdown-item:active {
    background-color: rgba(45, 125, 70, 0.2);
    color: var(--primary-dark);
}
.dropdown-menu {
    background-color: var(--white);
    color: var(--dark);
}
.dropdown-item { color: var(--dark); }
.dropdown-divider { border-top-color: var(--gray-300); }

/* Alto contraste Perfil */
.high-contrast-mode .profile-menu {
    background-color: #000 !important;
    border: 2px solid #fff !important;
}
.high-contrast-mode .profile-menu .dropdown-item { color: #fff !important; }
.high-contrast-mode .profile-menu .dropdown-item:hover,
.high-contrast-mode .profile-menu .dropdown-item:active {
    background-color: #333 !important;
    color: #ffff00 !important;
}
.high-contrast-mode .profile-menu .dropdown-divider { border-top-color: #fff !important; }

/* Responsividade */
@media (max-width: 991.98px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    .logo-container, .title-container {
        margin-bottom: 15px;
        width: 100%;
    }
    .top-bar, .user-info {
        text-align: center;
        justify-content: center;
    }
    .navbar-custom .navbar-nav .nav-link::after { display: none; }
    .dropdown-menu {
        border: none;
        box-shadow: none;
        background-color: rgba(255, 255, 255, 0.05);
        padding: 0;
    }
    .dropdown-item {
        color: var(--white);
        padding: 10px 20px;
    }
    .dropdown-item:hover, .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--white);
    }
    .dropdown-divider { border-top-color: rgba(255, 255, 255, 0.1); }
    .sistemas-dropdown-menu {
        width: 100%;
        background-color: rgba(255, 255, 255, 0.05);
    }
    .sistemas-dropdown-menu .dropdown-header {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--white);
        border-radius: 0;
    }
    .sistemas-dropdown-menu .dropdown-item { color: var(--white); }
    .sistemas-dropdown-menu .dropdown-item:hover,
    .sistemas-dropdown-menu .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--white);
    }
    .sistemas-dropdown-menu .dropdown-item i { color: var(--white); }
    .sistemas-dropdown-menu .view-all { color: var(--white) !important; }
}

@media (max-width: 768px) {
    .a11y-top-bar {
        flex-direction: column;
        gap: 10px;
    }
    .a11y-tools {
        width: 100%;
        justify-content: center;
    }
    .user-info {
        width: 100%;
        justify-content: center;
    }
    .a11y-text { display: none; }
    .a11y-btn-sm { padding: 6px; }
    .a11y-btn-sm i { font-size: 16px; }
    
    .user-profile {
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
    }
    .profile-menu {
        position: static !important;
        width: 100%;
        margin: 5px 0 !important;
        transform: none !important;
    }
    .profile-menu .dropdown-item,
    .profile-menu .dropdown-item:hover,
    .profile-menu .dropdown-item:active { color: var(--dark); }
}

@media (max-width: 767.98px) {
    .notification-badge {
        margin-left: 10px;
        margin-right: 5px;
    }
    .notification-menu {
        width: 300px;
        max-width: 100vw;
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Tema escuro: superfícies neutras e verdes suaves para leitura prolongada. */
body.dark-mode {
    --dark-mode-bg: #111714;
    --dark-mode-text: #e5ece8;
    --dark-mode-card-bg: #1b2520;
    --dark-mode-surface-raised: #232f29;
    --dark-mode-border: #394840;
    --dark-mode-link: #9bd6af;
    --dark-mode-link-hover: #c1ebce;
    --dark-mode-muted: #adbbb2;
    --dark-mode-focus: #f2c66d;
    background: var(--dark-mode-bg) !important;
    color: var(--dark-mode-text) !important;
    color-scheme: dark;
}
body.dark-mode .navbar-custom,
body.dark-mode .hero-section,
body.dark-mode .section-header,
body.dark-mode .page-header {
    background-image: linear-gradient(135deg, #1b3023, #14221a) !important;
}

body.dark-mode main,
body.dark-mode .main-content,
body.dark-mode .container-fluid,
body.dark-mode .content-wrapper,
body.dark-mode .page-content,
body.dark-mode .terms-container,
body.dark-mode .terms-content,
body.dark-mode .term-header,
body.dark-mode .hero-section,
body.dark-mode .custom-hero {
    background-color: var(--dark-mode-bg) !important;
    color: var(--dark-mode-text) !important;
}

body.dark-mode .card,
body.dark-mode .card-header,
body.dark-mode .card-body,
body.dark-mode .card-footer,
body.dark-mode .modal-content,
body.dark-mode .offcanvas,
body.dark-mode .list-group-item,
body.dark-mode .accordion-item,
body.dark-mode .accordion-button,
body.dark-mode .popover,
body.dark-mode .toast,
body.dark-mode .table,
body.dark-mode .table-responsive,
body.dark-mode .bg-white,
body.dark-mode .bg-light {
    background-color: var(--dark-mode-card-bg) !important;
    color: var(--dark-mode-text) !important;
    border-color: var(--dark-mode-border) !important;
}

body.dark-mode .table,
body.dark-mode .table > :not(caption) > * > *,
body.dark-mode .list-group-item,
body.dark-mode .accordion-item,
body.dark-mode .card,
body.dark-mode .card-header,
body.dark-mode .card-footer,
body.dark-mode hr,
body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom {
    border-color: var(--dark-mode-border) !important;
}

body.dark-mode .table > :not(caption) > * > *,
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > *,
body.dark-mode .table-hover > tbody > tr:hover > * {
    --bs-table-bg: var(--dark-mode-card-bg);
    --bs-table-color: var(--dark-mode-text);
    --bs-table-striped-bg: #202b25;
    --bs-table-striped-color: var(--dark-mode-text);
    --bs-table-hover-bg: #2a3830;
    --bs-table-hover-color: #f3f7f4;
    background-color: var(--bs-table-bg) !important;
    color: var(--bs-table-color) !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode label,
body.dark-mode legend,
body.dark-mode dt,
body.dark-mode dd,
body.dark-mode li,
body.dark-mode th,
body.dark-mode td,
body.dark-mode .form-label,
body.dark-mode .accordion-body,
body.dark-mode .modal-title,
body.dark-mode .popover-body,
body.dark-mode .form-check-label {
    color: var(--dark-mode-text) !important;
}

body.dark-mode .text-dark,
body.dark-mode .text-body,
body.dark-mode .text-secondary,
body.dark-mode .text-muted,
body.dark-mode .terms-content h2,
body.dark-mode .terms-content p,
body.dark-mode .terms-content li,
body.dark-mode .terms-content strong,
body.dark-mode .hero-title,
body.dark-mode .hero-subtitle {
    color: var(--dark-mode-muted) !important;
}

body.dark-mode a:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: var(--dark-mode-link);
}
body.dark-mode a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: var(--dark-mode-link-hover);
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .form-check-input,
body.dark-mode input:not([type="checkbox"]):not([type="radio"]),
body.dark-mode select,
body.dark-mode textarea {
    background-color: #151e19 !important;
    color: var(--dark-mode-text) !important;
    border-color: #506157 !important;
}
body.dark-mode .form-control::placeholder,
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #a9b7ae !important;
    opacity: 1;
}
body.dark-mode option { background-color: #1b2520; color: var(--dark-mode-text); }
body.dark-mode input:disabled,
body.dark-mode select:disabled,
body.dark-mode textarea:disabled { background-color: #202923 !important; color: #b4c0b8 !important; }

body.dark-mode .dropdown-menu,
body.dark-mode .dropdown-item,
body.dark-mode .profile-menu,
body.dark-mode .notification-menu,
body.dark-mode .sistemas-dropdown-menu,
body.dark-mode .notification-item,
body.dark-mode .profile-menu .dropdown-item,
body.dark-mode .sistemas-dropdown-menu .dropdown-item {
    background-color: var(--dark-mode-card-bg) !important;
    color: var(--dark-mode-text) !important;
    border-color: var(--dark-mode-border) !important;
}
body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus,
body.dark-mode .list-group-item-action:hover,
body.dark-mode .list-group-item-action:focus {
    background-color: #2a3830 !important;
    color: #f3f7f4 !important;
}

body.dark-mode .accordion-button:not(.collapsed) {
    background-color: #25352b !important;
    color: #d8f0df !important;
}
body.dark-mode .accordion-button::after {
    filter: invert(1) grayscale(1);
}
body.dark-mode .btn-close { filter: invert(1) grayscale(1); }
body.dark-mode .btn-outline-primary,
body.dark-mode .btn-outline-success,
body.dark-mode .btn-outline-info,
body.dark-mode .btn-outline-warning,
body.dark-mode .btn-outline-danger {
    filter: brightness(1.2);
}
body.dark-mode .btn-outline-secondary {
    color: var(--dark-mode-text) !important;
    border-color: #829188 !important;
}
body.dark-mode .btn-outline-secondary:hover {
    background-color: #344239 !important;
    color: #fff !important;
}

body.dark-mode .alert-success { background-color: #183426 !important; color: #c9f0d5 !important; border-color: #35684a !important; }
body.dark-mode .alert-info { background-color: #17313a !important; color: #c7eaf1 !important; border-color: #376675 !important; }
body.dark-mode .alert-warning { background-color: #3a3019 !important; color: #ffedbf !important; border-color: #74602d !important; }
body.dark-mode .alert-danger { background-color: #3b2224 !important; color: #ffd8d8 !important; border-color: #754044 !important; }
body.dark-mode .badge.bg-light,
body.dark-mode .badge.text-dark { background-color: #344239 !important; color: #f0f4f1 !important; }
body.dark-mode .pagination .page-link { background-color: var(--dark-mode-card-bg); color: var(--dark-mode-link); border-color: var(--dark-mode-border); }
body.dark-mode .pagination .active > .page-link { background-color: #28633d; color: #fff; border-color: #398052; }
body.dark-mode .progress { background-color: #303b34; }
body.dark-mode .a11y-btn,
body.dark-mode .a11y-btn-sm { background-color: #2b3a31 !important; color: #edf5ef !important; border: 1px solid #54675a !important; }
body.dark-mode .a11y-btn:hover,
body.dark-mode .a11y-btn-sm:hover { background-color: #385442 !important; }

/* Cards do Portal de Serviços */
body.dark-mode .service-card,
body.dark-mode .user-welcome,
body.dark-mode .search-container {
    background-color: #1b2520 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}
body.dark-mode .service-card:hover,
body.dark-mode .service-card:focus-visible {
    background-color: #222f28 !important;
    border-color: #52735d !important;
    color: #f3f7f4 !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32) !important;
}
body.dark-mode .service-card .service-title,
body.dark-mode .user-welcome,
body.dark-mode .user-welcome strong,
body.dark-mode .category-title {
    color: #e5ece8 !important;
}
body.dark-mode .user-welcome .user-avatar {
    background: linear-gradient(135deg, #28633d, #3d8a56) !important;
    color: #fff !important;
}
body.dark-mode .service-card .service-description,
body.dark-mode .last-login,
body.dark-mode .no-results {
    color: #b5c2b9 !important;
}
body.dark-mode .service-card > i.bi {
    background-color: #2b3b31 !important;
    color: #a6dfb6 !important;
}
body.dark-mode .service-card:hover > i.bi {
    background-color: #365442 !important;
    color: #d0f0d8 !important;
}
body.dark-mode .search-container .search-icon { color: #a6dfb6 !important; }
body.dark-mode .search-container .search-input {
    background: transparent !important;
    color: #e5ece8 !important;
}
body.dark-mode .search-container .search-input::placeholder { color: #aab8af !important; }

/* Rodapé compartilhado */
body.dark-mode footer,
body.dark-mode footer .footer-content,
body.dark-mode footer .copyright-bar {
    background-color: #151e19 !important;
    color: #dce6df !important;
    border-color: #394840 !important;
}
body.dark-mode footer .copyright-bar {
    background-image: linear-gradient(135deg, #1b3023, #14221a) !important;
}
body.dark-mode footer .footer-heading { color: #c5e8cf !important; }
body.dark-mode footer .footer-description,
body.dark-mode footer .footer-links a,
body.dark-mode footer .contact-item p,
body.dark-mode footer .copyright-text,
body.dark-mode footer .terms-links,
body.dark-mode footer .terms-links a {
    color: #b5c2b9 !important;
}
body.dark-mode footer .footer-links a i,
body.dark-mode footer .contact-item i { color: #9bd6af !important; }
body.dark-mode footer .social-link {
    background-color: #2b3b31 !important;
    color: #bce8c8 !important;
}
body.dark-mode footer .social-link:hover {
    background-color: #356343 !important;
    color: #fff !important;
}
body.dark-mode footer a:hover { color: #d2f0da !important; }

/* Ferramentas reutilizadas nas telas independentes de login e diagnóstico. */
.a11y-standalone-tools {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 1280px;
    margin: 10px auto;
    padding: 0 16px;
}
.a11y-standalone-tools .a11y-btn-sm {
    background: #245b36;
    border: 1px solid #d5e6d9;
    color: #fff;
    min-height: 36px;
}
body.dark-mode .a11y-standalone-tools .a11y-btn-sm {
    background: #2b3b31 !important;
    border-color: #718479 !important;
    color: #f2f7f3 !important;
}

/* Componentes exclusivos de telas de erro, diagnóstico e importação. */
body.dark-mode .error-card,
body.dark-mode .error-meta,
body.dark-mode .section,
body.dark-mode .tabs,
body.dark-mode .upload-area,
body.dark-mode .summary-bar,
body.dark-mode .legenda,
body.dark-mode .map-row.row-pendente {
    background-color: #1b2520 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .error-title,
body.dark-mode .error-text,
body.dark-mode .error-meta,
body.dark-mode .section h2,
body.dark-mode .section p,
body.dark-mode .section li,
body.dark-mode .planilha-val,
body.dark-mode .note,
body.dark-mode .upload-label,
body.dark-mode .legenda {
    color: #d3ded6 !important;
}
body.dark-mode .header {
    background: linear-gradient(135deg, #1b3023, #14221a) !important;
    color: #edf5ef !important;
}
body.dark-mode .header h1,
body.dark-mode .header p { color: #edf5ef !important; }
body.dark-mode .tab-btn { color: #d3ded6 !important; }
body.dark-mode .tab-btn.active { background-color: #28633d !important; color: #fff !important; }
body.dark-mode .tab-btn:hover:not(.active) { background-color: #2a3830 !important; }
body.dark-mode .map-row.row-modificado,
body.dark-mode .estado-modificado { background-color: #3a3019 !important; color: #ffedbf !important; }
body.dark-mode .map-row.row-conferido,
body.dark-mode .map-row.row-conferido-mod,
body.dark-mode .estado-conferido { background-color: #183426 !important; color: #c9f0d5 !important; }
body.dark-mode .estado-pendente { background-color: #303b34 !important; color: #e5ece8 !important; }
body.dark-mode .preview-table tr:nth-child(even) td { background-color: #202b25 !important; color: #e5ece8 !important; }
body.dark-mode .preview-container { border-color: #394840 !important; }
body.dark-mode .section.success { background-color: #183426 !important; color: #c9f0d5 !important; }
body.dark-mode .section.warning { background-color: #3a3019 !important; color: #ffedbf !important; }
body.dark-mode .section.error { background-color: #3b2224 !important; color: #ffd8d8 !important; }

/* Uniformiza componentes claros presentes em páginas com CSS próprio. */
body.dark-mode .bg-body,
body.dark-mode .bg-body-tertiary,
body.dark-mode .bg-light,
body.dark-mode .bg-white,
body.dark-mode .bg-secondary-subtle,
body.dark-mode .bg-primary-subtle,
body.dark-mode .bg-success-subtle,
body.dark-mode .bg-info-subtle,
body.dark-mode .bg-warning-subtle,
body.dark-mode .bg-danger-subtle,
body.dark-mode .panel,
body.dark-mode .well,
body.dark-mode .jumbotron,
body.dark-mode .content-box,
body.dark-mode .info-box,
body.dark-mode .stat-card,
body.dark-mode .summary-card,
body.dark-mode .filter-panel,
body.dark-mode .search-panel,
body.dark-mode .dataTables_wrapper .dataTables_filter input,
body.dark-mode .dataTables_wrapper .dataTables_length select,
body.dark-mode .select2-container--default .select2-selection,
body.dark-mode .select2-dropdown,
body.dark-mode .choices__inner,
body.dark-mode .choices__list--dropdown {
    background-color: #1b2520 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}

body.dark-mode [style*="background: #fff" i],
body.dark-mode [style*="background:#fff" i],
body.dark-mode [style*="background-color: #fff" i],
body.dark-mode [style*="background-color:#fff" i],
body.dark-mode [style*="background: white" i],
body.dark-mode [style*="background-color: white" i],
body.dark-mode [style*="background: rgb(255, 255, 255)" i],
body.dark-mode [style*="background-color: rgb(255, 255, 255)" i],
body.dark-mode [style*="background: #f8f9fa" i],
body.dark-mode [style*="background-color: #f8f9fa" i],
body.dark-mode [style*="background: #f5f5f5" i],
body.dark-mode [style*="background-color: #f5f5f5" i] {
    background-color: #1b2520 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode [style*="color: #000" i],
body.dark-mode [style*="color:#000" i],
body.dark-mode [style*="color: black" i],
body.dark-mode [style*="color: #212529" i],
body.dark-mode [style*="color: #343a40" i] {
    color: #e5ece8 !important;
}
body.dark-mode .table-light,
body.dark-mode .table-light > *,
body.dark-mode .table-light th,
body.dark-mode .table-light td {
    background-color: #202b25 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .modal-header,
body.dark-mode .modal-footer,
body.dark-mode .offcanvas-header,
body.dark-mode .popover-header {
    background-color: #202b25 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .btn-light,
body.dark-mode .btn-outline-light {
    background-color: #26332b !important;
    color: #e5ece8 !important;
    border-color: #596a5f !important;
}
body.dark-mode .btn-light:hover,
body.dark-mode .btn-outline-light:hover {
    background-color: #35483b !important;
    color: #fff !important;
}
body.dark-mode .bg-success-subtle { background-color: #183426 !important; color: #c9f0d5 !important; }
body.dark-mode .bg-info-subtle { background-color: #17313a !important; color: #c7eaf1 !important; }
body.dark-mode .bg-warning-subtle { background-color: #3a3019 !important; color: #ffedbf !important; }
body.dark-mode .bg-danger-subtle { background-color: #3b2224 !important; color: #ffd8d8 !important; }
body.dark-mode .bg-primary-subtle { background-color: #1c2e42 !important; color: #d1e4ff !important; }

/* Sobrescritas para as páginas de chamados, treinamentos e ativos. */
body.dark-mode .filters-card,
body.dark-mode .filters-header,
body.dark-mode .filters-body,
body.dark-mode .chamado-card,
body.dark-mode .chamado-header,
body.dark-mode .chamado-body,
body.dark-mode .chamado-footer,
body.dark-mode .stat-card,
body.dark-mode .empty-state,
body.dark-mode .filter-card,
body.dark-mode .tecnico-stat-card,
body.dark-mode .tecnico-section,
body.dark-mode .tecnico-header,
body.dark-mode .chamado-row,
body.dark-mode .filtro-ativo,
body.dark-mode .filtro-ativo-info,
body.dark-mode .success-message,
body.dark-mode .sidebar,
body.dark-mode .sidebar-header,
body.dark-mode .sidebar-body,
body.dark-mode .sidebar .list-group-item,
body.dark-mode .training-card,
body.dark-mode .file-upload-wrapper,
body.dark-mode .ativo-lista,
body.dark-mode .ativo-item,
body.dark-mode .recent-box,
body.dark-mode .count-pill,
body.dark-mode .recent-badge,
body.dark-mode .meta-system,
body.dark-mode .form-container,
body.dark-mode .form-section,
body.dark-mode .form-section:last-child,
body.dark-mode .status-option,
body.dark-mode .file-upload-label,
body.dark-mode .file-preview,
body.dark-mode .content-wrapper,
body.dark-mode .tipo-card,
body.dark-mode .tipo-header,
body.dark-mode .tipo-info,
body.dark-mode .tecnicos-selection,
body.dark-mode .tecnico-item,
body.dark-mode .vinculo-item,
body.dark-mode .summary-box,
body.dark-mode .equipment-item,
body.dark-mode .step-content,
body.dark-mode .info-box,
body.dark-mode .empty-tecnico {
    background-color: #1b2520 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .filters-header,
body.dark-mode .chamado-header,
body.dark-mode .tecnico-header,
body.dark-mode .sidebar-header,
body.dark-mode .tipo-header {
    background: #202d25 !important;
    color: #e5ece8 !important;
}
body.dark-mode .sidebar .list-group-item.active,
body.dark-mode .view-tab.active,
body.dark-mode .filter-toggle a.active,
body.dark-mode .step.active .step-number,
body.dark-mode .step.completed .step-number {
    background-color: #28633d !important;
    border-color: #67a879 !important;
    color: #fff !important;
}
body.dark-mode .sidebar .list-group-item,
body.dark-mode .view-tab,
body.dark-mode .filter-toggle a:not(.active),
body.dark-mode .step-text,
body.dark-mode .step-content,
body.dark-mode .filters-title,
body.dark-mode .filter-card .filter-title,
body.dark-mode .section-title,
body.dark-mode .tipo-info,
body.dark-mode .status-title,
body.dark-mode .status-description,
body.dark-mode .status-label,
body.dark-mode .status-option .status-label,
body.dark-mode .chamado-title,
body.dark-mode .chamado-type,
body.dark-mode .info-value,
body.dark-mode .summary-value,
body.dark-mode .field-value,
body.dark-mode .tsc-name,
body.dark-mode .ativo-nome,
body.dark-mode .ativo-conteudo,
body.dark-mode .tecnico-info,
body.dark-mode .recent-title,
body.dark-mode .training-card,
body.dark-mode .empty-state-title,
body.dark-mode .empty-title,
body.dark-mode .empty-message {
    color: #e5ece8 !important;
}
body.dark-mode .chamado-number,
body.dark-mode .info-label,
body.dark-mode .sla-label,
body.dark-mode .stat-label,
body.dark-mode .field-label,
body.dark-mode .tsc-lbl,
body.dark-mode .ativo-detalhes,
body.dark-mode .recent-box,
body.dark-mode .empty-state-text,
body.dark-mode .empty-icon,
body.dark-mode .empty-tecnico,
body.dark-mode .step-text:not(.active):not(.completed) {
    color: #b5c2b9 !important;
}
body.dark-mode .filters-title,
body.dark-mode .filter-card .filter-title,
body.dark-mode .section-title,
body.dark-mode .stat-value,
body.dark-mode .stat-icon,
body.dark-mode .tipo-icon,
body.dark-mode .training-icon,
body.dark-mode .recent-title,
body.dark-mode .filtro-ativo-info .bi {
    color: #a6dfb6 !important;
}
body.dark-mode .video-thumb,
body.dark-mode .play-btn,
body.dark-mode .training-icon {
    background-color: #2b3b31 !important;
    color: #bce8c8 !important;
    border-color: #506457 !important;
}
body.dark-mode .chamado-card:hover,
body.dark-mode .ativo-item:hover,
body.dark-mode .equipment-item:hover,
body.dark-mode .tecnico-item:hover,
body.dark-mode .vinculo-item:hover,
body.dark-mode .tipo-card:hover,
body.dark-mode .training-card:hover {
    background-color: #24332a !important;
    border-color: #52735d !important;
}
body.dark-mode .tipo-card.selected,
body.dark-mode .equipment-item.selected,
body.dark-mode .status-option input[type="radio"]:checked + .status-label {
    background-color: #1d3928 !important;
    border-color: #67a879 !important;
}

/* Mantém estados de prioridade e SLA distinguíveis também sobre o fundo escuro. */
body.dark-mode .priority-baixa,
body.dark-mode .sla-ok,
body.dark-mode .status-badge.status-ativo,
body.dark-mode .garantia-valida,
body.dark-mode .status-ativo .status-label {
    background-color: #183426 !important;
    color: #c9f0d5 !important;
}
body.dark-mode .priority-normal {
    background-color: #17313a !important;
    color: #c7eaf1 !important;
}
body.dark-mode .priority-alta,
body.dark-mode .garantia-proxima,
body.dark-mode .sla-warning,
body.dark-mode .status-badge.status-manutencao,
body.dark-mode .status-manutencao .status-label {
    background-color: #3a3019 !important;
    color: #ffedbf !important;
}
body.dark-mode .sla-expired,
body.dark-mode .priority-urgente,
body.dark-mode .garantia-vencida,
body.dark-mode .status-badge.status-inativo,
body.dark-mode .status-badge.status-baixado,
body.dark-mode .status-baixado .status-label {
    background-color: #3b2224 !important;
    color: #ffd8d8 !important;
}
body.dark-mode .status-inativo .status-label {
    background-color: #303b34 !important;
    color: #e5ece8 !important;
}
body.dark-mode .success-message .success-title,
body.dark-mode .success-message .success-text { color: #c9f0d5 !important; }
body.dark-mode .success-message .success-icon { color: #8dd7a1 !important; }
body.dark-mode .filtro-ativo .btn-link,
body.dark-mode .filtro-ativo-info .btn-link,
body.dark-mode .chamado-numero a,
body.dark-mode .view-tab:hover { color: #a9dfb8 !important; }
body.dark-mode .status-option:hover .status-label,
body.dark-mode .status-ativo .status-label,
body.dark-mode .status-inativo .status-label,
body.dark-mode .status-manutencao .status-label,
body.dark-mode .status-baixado .status-label {
    color: #e5ece8 !important;
}
body.dark-mode .status-ativo .status-icon { color: #a8e3b7 !important; }
body.dark-mode .status-inativo .status-icon,
body.dark-mode .status-baixado .status-icon { color: #ffb4b4 !important; }
body.dark-mode .status-manutencao .status-icon { color: #ffe09a !important; }
body.dark-mode .page-header { color: #edf5ef !important; }
body.dark-mode .file-upload-label.has-file {
    background-color: #183426 !important;
    border-color: #67a879 !important;
    color: #c9f0d5 !important;
}
body.dark-mode .count-pill,
body.dark-mode .recent-badge {
    background-color: #344239 !important;
    color: #dce6df !important;
}
body.dark-mode .empty-icon,
body.dark-mode .ativo-icone,
body.dark-mode .tipo-icon {
    color: #a6dfb6 !important;
}
body.dark-mode .text-black,
body.dark-mode .text-black-50,
body.dark-mode .text-body-secondary,
body.dark-mode .form-text,
body.dark-mode small,
body.dark-mode .small {
    color: #b5c2b9 !important;
}
body.dark-mode .text-primary { color: #a9caff !important; }
body.dark-mode .text-success { color: #a8e3b7 !important; }
body.dark-mode .text-info { color: #a9e3ee !important; }
body.dark-mode .text-warning { color: #ffe09a !important; }
body.dark-mode .text-danger { color: #ffb4b4 !important; }

/* Complementos de contraste para telas com gradientes e cores locais fixas. */
body.dark-mode .alert-success,
body.dark-mode .alert-info,
body.dark-mode .alert-warning,
body.dark-mode .alert-danger,
body.dark-mode .success-message,
body.dark-mode .filtro-ativo-info,
body.dark-mode .filtro-ativo,
body.dark-mode .tecnico-stat-card.total,
body.dark-mode .info-box {
    background-image: none !important;
}
body.dark-mode .alert-success { background-color: #183426 !important; color: #c9f0d5 !important; }
body.dark-mode .alert-info { background-color: #17313a !important; color: #c7eaf1 !important; }
body.dark-mode .alert-warning { background-color: #3a3019 !important; color: #ffedbf !important; }
body.dark-mode .alert-danger { background-color: #3b2224 !important; color: #ffd8d8 !important; }
body.dark-mode .success-message { background-color: #183426 !important; border-color: #35684a !important; }
body.dark-mode .filtro-ativo-info,
body.dark-mode .filtro-ativo { background-color: #1c2e42 !important; border-color: #44698e !important; color: #d1e4ff !important; }
body.dark-mode .tecnico-stat-card,
body.dark-mode .tecnico-stat-card.total,
body.dark-mode .tecnico-section,
body.dark-mode .equipment-list,
body.dark-mode .file-upload-container,
body.dark-mode .vinculos-grid {
    background-color: #1b2520 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .recent-list a {
    background-color: #202b25 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .recent-list a:hover {
    background-color: #2a3830 !important;
    color: #f3f7f4 !important;
    border-color: #52735d !important;
}
body.dark-mode .meta-system,
body.dark-mode .empty-state-text,
body.dark-mode .empty-state i,
body.dark-mode .tsc-lbl,
body.dark-mode .field-label,
body.dark-mode .step-text:not(.active):not(.completed),
body.dark-mode .file-upload-text,
body.dark-mode .file-upload-icon {
    color: #b5c2b9 !important;
}
body.dark-mode .empty-state-title,
body.dark-mode .recent-title,
body.dark-mode .tsc-name,
body.dark-mode .step-text.active,
body.dark-mode .step-text.completed,
body.dark-mode .summary-label {
    color: #e5ece8 !important;
}
body.dark-mode .tecnico-stat-card.total .tsc-name,
body.dark-mode .tecnico-stat-card.total .tsc-lbl { color: #e5ece8 !important; }
body.dark-mode .tecnico-header .count-abertos {
    background-color: #5a461b !important;
    color: #ffedbf !important;
}
body.dark-mode .tecnico-header .count-abertos.vazio {
    background-color: #245139 !important;
    color: #d7f3df !important;
}
body.dark-mode .chamado-field { border-color: #394840 !important; }
body.dark-mode .summary-field { border-color: #394840 !important; }
body.dark-mode .step-number { background-color: #394840 !important; color: #e5ece8 !important; }
body.dark-mode .tipo-icon,
body.dark-mode .ativo-icone { background-color: #2b3b31 !important; }
body.dark-mode .sep { color: #819087 !important; }
body.dark-mode .step:not(:last-child)::after { background-color: #506157 !important; }
body.dark-mode .step.active .step-number,
body.dark-mode .step.completed .step-number { color: #fff !important; }
body.dark-mode #setor_id:disabled { background-color: #202923 !important; color: #b4c0b8 !important; }
body.dark-mode .file-upload-container:hover,
body.dark-mode .equipment-item:hover { background-color: #24332a !important; }
body.dark-mode .file-upload-container,
body.dark-mode .file-upload-container * { color: #dce6df; }
body.dark-mode .filtro-ativo-info .bi,
body.dark-mode .filtro-ativo .bi { color: #b8d9ff !important; }
body.dark-mode .filtro-ativo-info .btn-link,
body.dark-mode .filtro-ativo .btn-link { color: #b8d9ff !important; }
body.dark-mode .form-select option,
body.dark-mode select.form-select option { background-color: #1b2520 !important; color: #e5ece8 !important; }

/* Visualização de chamado: descrição, SLA, histórico e anexos. */
body.dark-mode .description-container,
body.dark-mode .info-item,
body.dark-mode .timeline-content,
body.dark-mode .tab-content,
body.dark-mode .attachment-item,
body.dark-mode .pdf-container {
    background-color: #1b2520 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .timeline-point {
    background-color: #202d25 !important;
    color: #a6dfb6 !important;
    border-color: #67a879 !important;
}
body.dark-mode .timeline::before { background-color: #506157 !important; }
body.dark-mode .timeline-title,
body.dark-mode .description-title,
body.dark-mode .sla-title,
body.dark-mode .attachment-name { color: #e5ece8 !important; }
body.dark-mode .timeline-time,
body.dark-mode .attachment-meta,
body.dark-mode .sla-text,
body.dark-mode .info-label,
body.dark-mode .attachment-icon { color: #b5c2b9 !important; }
body.dark-mode .timeline-privado { background-color: #3a3019 !important; border-color: #8b7136 !important; }
body.dark-mode .sla-ok { background-color: #183426 !important; border-color: #4d8a60 !important; }
body.dark-mode .sla-warning { background-color: #3a3019 !important; border-color: #8b7136 !important; }
body.dark-mode .sla-expired { background-color: #3b2224 !important; border-color: #8b4a4f !important; }
body.dark-mode .sla-ok .sla-title,
body.dark-mode .sla-ok .sla-text { color: #c9f0d5 !important; }
body.dark-mode .sla-warning .sla-title,
body.dark-mode .sla-warning .sla-text { color: #ffedbf !important; }
body.dark-mode .sla-expired .sla-title,
body.dark-mode .sla-expired .sla-text { color: #ffd8d8 !important; }
body.dark-mode .nav-tabs { border-color: #394840 !important; }
body.dark-mode .nav-tabs .nav-link { color: #b5c2b9 !important; }
body.dark-mode .nav-tabs .nav-link.active { color: #bce8c8 !important; border-color: #67a879 !important; }
body.dark-mode .anydesk-highlight { background: #183426 !important; color: #dcefe1 !important; }
body.dark-mode .anydesk-code { color: #a8e3b7 !important; }

/* Lista de solicitações: cabeçalhos, cartões de dados, observações e estados. */
body.dark-mode .sol-card,
body.dark-mode .sol-body,
body.dark-mode .info-item {
    background-color: #1b2520 !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .sol-header {
    background-color: #202d25 !important;
    background-image: none !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .sol-title,
body.dark-mode .info-value { color: #e5ece8 !important; }
body.dark-mode .sol-sub,
body.dark-mode .info-label,
body.dark-mode .info-value.muted,
body.dark-mode .empty-state p { color: #b5c2b9 !important; }
body.dark-mode .info-item:hover { background-color: #24332a !important; border-color: #52735d !important; }
body.dark-mode .sol-actions { border-color: #394840 !important; }
body.dark-mode .obs-box { background-color: #183426 !important; color: #dcefe1 !important; border-color: #35684a !important; }
body.dark-mode .obs-box strong { color: #c9f0d5 !important; }
body.dark-mode .chip-success,
body.dark-mode .status-aprovado { background-color: #183426 !important; color: #c9f0d5 !important; border-color: #35684a !important; }
body.dark-mode .chip-warning,
body.dark-mode .status-pendente { background-color: #3a3019 !important; color: #ffedbf !important; border-color: #74602d !important; }
body.dark-mode .chip-danger,
body.dark-mode .status-rejeitado { background-color: #3b2224 !important; color: #ffd8d8 !important; border-color: #754044 !important; }
body.dark-mode .avatar { background-color: #2b3b31 !important; color: #c9f0d5 !important; }
body.dark-mode .nav-tabs .nav-link:hover { background-color: #26372c !important; color: #c9f0d5 !important; }
body.dark-mode .btn-outline-success { color: #a8e3b7 !important; border-color: #67a879 !important; }
body.dark-mode .btn-outline-success:hover { background-color: #28633d !important; color: #fff !important; }
body.dark-mode .btn-outline-secondary { color: #dce6df !important; border-color: #718479 !important; }
body.dark-mode .btn-outline-secondary:hover { background-color: #344239 !important; color: #fff !important; }

/* Listagem de chamados: filtros recolhíveis e metadados do cartão. */
body.dark-mode .toggle-filters { color: #bce8c8 !important; }
body.dark-mode .chamado-description { color: #dce6df !important; }
body.dark-mode .chamado-last-update,
body.dark-mode .chamado-number,
body.dark-mode .info-label,
body.dark-mode .sla-label { color: #b5c2b9 !important; }
body.dark-mode .chamado-type {
    background-color: #263a2e !important;
    color: #c9f0d5 !important;
    border: 1px solid #506b59;
}
body.dark-mode .status-badge {
    border: 1px solid rgba(255, 255, 255, .32);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
/* A listagem define fundos claros em estilos locais; force as superfícies dos cards no tema escuro. */
body.dark-mode .filters-card,
body.dark-mode .filters-header,
body.dark-mode .filters-body,
body.dark-mode .chamado-card,
body.dark-mode .chamado-card .chamado-header,
body.dark-mode .chamado-card .chamado-body,
body.dark-mode .chamado-card .chamado-footer,
body.dark-mode .stat-card,
body.dark-mode .empty-state {
    background-color: #1b2520 !important;
    background-image: none !important;
    color: #e5ece8 !important;
    border-color: #394840 !important;
}
body.dark-mode .chamado-card .chamado-header,
body.dark-mode .filters-header,
body.dark-mode .chamado-card .chamado-footer {
    background-color: #202d25 !important;
}
body.dark-mode .filters-title,
body.dark-mode .chamado-title,
body.dark-mode .stat-label,
body.dark-mode .empty-title { color: #e5ece8 !important; }
body.dark-mode .stat-value { color: #a8e3b7 !important; }
body.dark-mode .empty-message { color: #b5c2b9 !important; }

/* Alto contraste: modo monocromático previsível, legível e sem superfícies claras residuais. */
body.high-contrast-mode,
body.high-contrast-mode * {
    color: #fff !important;
    background-color: #000 !important;
    background-image: none !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
body.high-contrast-mode {
    color-scheme: dark;
}
body.high-contrast-mode a,
body.high-contrast-mode a:visited,
body.high-contrast-mode a .bi {
    color: #ff0 !important;
    text-decoration: underline !important;
}
body.high-contrast-mode a:hover,
body.high-contrast-mode a:focus-visible,
body.high-contrast-mode button:hover,
body.high-contrast-mode button:focus-visible {
    color: #000 !important;
    background-color: #ff0 !important;
}
body.high-contrast-mode a:hover .bi,
body.high-contrast-mode a:focus-visible .bi { color: #000 !important; }
body.high-contrast-mode button,
body.high-contrast-mode .btn,
body.high-contrast-mode input,
body.high-contrast-mode select,
body.high-contrast-mode textarea,
body.high-contrast-mode .form-control,
body.high-contrast-mode .form-select {
    color: #fff !important;
    background-color: #000 !important;
    border: 2px solid #fff !important;
}
body.high-contrast-mode button:disabled,
body.high-contrast-mode .btn:disabled,
body.high-contrast-mode input:disabled,
body.high-contrast-mode select:disabled,
body.high-contrast-mode textarea:disabled {
    color: #ddd !important;
    border-style: dashed !important;
}
body.high-contrast-mode input::placeholder,
body.high-contrast-mode textarea::placeholder,
body.high-contrast-mode select:invalid { color: #fff !important; opacity: 1 !important; }
body.high-contrast-mode :focus-visible {
    outline: 4px solid #0ff !important;
    outline-offset: 3px !important;
}
body.high-contrast-mode .navbar-toggler-icon {
    background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff) !important;
    background-size: 100% 2px !important;
    background-repeat: no-repeat !important;
    background-position: center 25%, center 50%, center 75% !important;
}
body.high-contrast-mode .btn-close {
    opacity: 1 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath stroke='white' stroke-linecap='round' stroke-width='2' d='m3 3 10 10M13 3 3 13'/%3E%3C/svg%3E") !important;
}
body.high-contrast-mode .accordion-button::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M1.5 5.5 8 12l6.5-6.5-1.4-1.4L8 9.2 2.9 4.1z'/%3E%3C/svg%3E") !important;
}
body.high-contrast-mode .progress { border: 2px solid #fff !important; }
body.high-contrast-mode .progress-bar { background-color: #fff !important; }
body.high-contrast-mode img,
body.high-contrast-mode video,
body.high-contrast-mode canvas {
    filter: none !important;
}

body.dark-mode :focus-visible,
body:not(.dark-mode) :focus-visible {
    outline: 3px solid #e6ad35 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(17, 23, 20, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    body, body *, body *::before, body *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
