:root {
    --primary: #0078d4;
    --primary-hover: #106ebe;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
    --border: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: var(--dark);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0078d4 0%, #005a9e 100%);
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.logo {
    text-align: center;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.logo-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 50%;
    background: white;
    padding: 4px;
}

.logo h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.logo p {
    font-size: 12px;
    opacity: 0.9;
}

/* ===== BOTÃO HAMBÚRGUER (abre/fecha a sidebar no mobile) ===== */
.btn-menu-toggle {
    display: none; /* só aparece em telas pequenas, ver media query */
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.btn-menu-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--dark);
    border-radius: 2px;
}

/* ===== OVERLAY (escurece o conteúdo quando a sidebar mobile está aberta) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1500;
}

.sidebar-overlay.ativo {
    display: block;
}

body.sidebar-aberta-lock {
    overflow: hidden;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.nav-item .icon {
    font-size: 20px;
    margin-right: 12px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 20px 40px;
    width: calc(100% - 260px);
}

.header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--primary);
    flex-wrap: wrap;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    min-width: 140px;
}

/* Campo de busca global dentro do header */
#busca-global-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.12);
    outline: none;
}

/* Seletor de tema menor */
.theme-selector select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    background: white;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.btn-import {
    align-items: center;
    background: white;
    border: 2px solid #6c757d;
    border-radius: 8px;
    color: var(--dark);
    color: var(--primary);
    color: #6c757d;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-size: 13px;
    font-weight: 600;
    font-weight: 500;
    gap: 8px;
    gap: 6px;
    grid-column: 1 / -1;
    justify-self: center;
    padding: 10px 20px;
    padding: 12px 24px;
    padding: 8px 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-import:hover {
    background: #6c757d;
    color: white;
}

.btn-clearduplicate {
    align-items: center;
    background: white;
    border: 2px solid #dc3545;
    border-radius: 8px;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
    padding: 8px 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-clearduplicate:hover {
    background: #dc3545;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-export {
    align-items: center;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    color: var(--dark);
    color: var(--primary);
    color: #6c757d;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-size: 13px;
    font-weight: 600;
    font-weight: 500;
    gap: 8px;
    gap: 6px;
    grid-column: 1 / -1;
    justify-self: center;
    padding: 10px 20px;
    padding: 12px 24px;
    padding: 8px 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-export:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ===== PAGES ===== */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s;
    transform: none; /* ✅ garante que nenhum transform residual quebre position:sticky dos filhos (ex.: mini calendário de disponibilidade) */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* Linha superior do page-header: ações à esquerda */
.page-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Linha de filtros do page-header */
.page-header .filter-bar {
    margin-bottom: 0;
}

/* Título de seção dentro do page-header */
.page-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    padding: 0;
}

/* Contador de resultados no page-header */
.page-results-count {
    font-size: 12px;
    color: #6c757d;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ===== FILTERS ===== */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* barra de resultados melhorada */

#material-results-info {
    display: none;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results-info-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.results-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.results-badge-number {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
}

.results-badge-label {
    color: #6c757d;
}

.results-badge.highlight {
    background: var(--primary);
    color: white;
}

.results-badge.highlight .results-badge-number,
.results-badge.highlight .results-badge-label {
    color: white;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-tag {
    display: inline-block;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.filter-tag-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-tag-remove:hover {
    opacity: 1;
}

/* Responsivo */








/* ===== CUSTOM DROPDOWN ===== */
.custom-dropdown {
    position: relative;
    display: inline-block;
    z-index: 100;
}

.custom-dropdown.open {
    z-index: 1001;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 160px;
    padding: 10px 15px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.dropdown-toggle:hover {
    border-color: var(--primary);
}

.dropdown-label {
    flex: 1;
    text-align: left;
    color: #495057;
}

.dropdown-label.has-selection {
    color: var(--primary);
    font-weight: 600;
}

.dropdown-arrow {
    font-size: 10px;
    color: #6c757d;
    transition: transform 0.3s;
}

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

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 280px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.custom-dropdown.open .dropdown-menu {
    display: block !important;
    animation: dropdownFadeIn 0.2s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-search {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

.dropdown-options {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    /* garante que as options empilham */
}

.dropdown-options::-webkit-scrollbar {
    width: 4px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ── DROPDOWN OPTION — fix checkbox imenso ──────────────────── */
.dropdown-options .dropdown-option {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 14px !important;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 36px;
    width: 100%;
    box-sizing: border-box;
}

.dropdown-options .dropdown-option:hover {
    background: #f0f7ff;
}

/* Checkbox: tamanho fixo, nunca cresce */
.dropdown-options .dropdown-option input[type="checkbox"] {
    display: block !important;
    /* anula qualquer display:none herdado */
    visibility: visible !important;
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    max-width: 15px !important;
    min-height: 15px !important;
    max-height: 15px !important;
    flex: 0 0 15px !important;
    /* não cresce, não encolhe */
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 3px;
    position: static !important;
    top: auto !important;
    left: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
}

/* Label: ocupa o restante, nunca some */
.dropdown-options .dropdown-option label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    cursor: pointer;
    font-size: 13px !important;
    line-height: 1.4 !important;
    color: #333 !important;
    white-space: normal;
    word-break: break-word;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 400 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
}

.dropdown-options .dropdown-option.hidden {
    display: none !important;
}

/* Destaque na opção selecionada */
.dropdown-options .dropdown-option:has(input:checked) {
    background: #e7f3ff;
}

.dropdown-options .dropdown-option:has(input:checked) label {
    color: var(--primary) !important;
    font-weight: 600 !important;
}

/* ── fim dropdown-option ─────────────────────────────────────── */

.dropdown-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: #f8f9fa;
}

.btn-dropdown-clear,
.btn-dropdown-apply {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-dropdown-clear {
    background: white;
    color: #6c757d;
    border: 1px solid var(--border);
}

.btn-dropdown-apply {
    background: var(--primary);
    color: white;
}

/* ===== CARDS ===== */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.card-subtitle {
    font-size: 13px;
    color: #6c757d;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: all 0.3s;
}

.card-actions button:hover {
    transform: scale(1.2);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-info-item {
    font-size: 14px;
    color: #495057;
}

.card-info-item strong {
    min-width: 120px;
    color: var(--dark);
}

/* ===== BADGES ===== */
.badge-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-status.ativo {
    background: #d4edda;
    color: #155724;
}

.badge-status.inativo {
    background: #f8d7da;
    color: #721c24;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.estoque {
    background: #e6f4ea;
    color: #1e7e34;
}

.status-badge.instalado {
    background: #e7f1ff;
    color: #0d6efd;
}

.status-badge.manutencao {
    background: #fff3cd;
    color: #856404;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.baixado {
    background: #f8d7da;
    color: #721c24;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.aguardando_aprovacao {
    background: #ffe5b4;
    color: #7d4e00;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-resumo.manutencao {
    background: #856404 !important;
}

.badge-resumo.baixado {
    background: #dc3545 !important;
}

.badge-resumo.estoque.activeestoque {
    box-shadow: 0 0 15px #33d47c !important;
    transform: scale(1.05) !important;
}

.badge-resumo.instalado.activeinstalado {
    box-shadow: 0 0 15px #0d9dfd !important;
    transform: scale(1.05) !important;
}

.badge-resumo.manutencao.activemanutencao {
    box-shadow: 0 0 15px rgba(175, 136, 19, 0.8) !important;
    transform: scale(1.05) !important;
}

.badge-resumo.baixado.activebaixado {
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.8) !important;
    transform: scale(1.05) !important;
}

/* ===== RESUMO STATUS (EQUIPAMENTOS) ===== */
.resumo-status {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.badge-resumo {
    padding: 12px;
    border-radius: 20px;
    font-weight: 600;
    color: white;
    min-width: 130px;
    cursor: pointer;
    transition: all 0.25s;
}

.badge-resumo.todos {
    background-color: #444;
}

.badge-resumo.estoque {
    background: #2ecc71;
}

.badge-resumo.instalado {
    background: #3498db;
}

.badge-resumo.badge-resumo.estoque.active-filters-list .badge-resumo:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.badge-resumo.active {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

/* FIX (pedido do usuário): todo .modal usava o mesmo z-index (1000), então
   quando um modal "secundário" (detalhe aberto por cima de outro, como
   Todos os Eventos/Férias, Gerenciar EMPs, Detalhes do Evento, ou o guia de
   Liberação de Períodos) era ativado enquanto o modal principal já estava
   aberto, a ordem de empilhamento dependia só de qual <div> vinha depois no
   HTML — não de qual foi aberto por último. Na prática, o modal novo às
   vezes abria "atrás" do que já estava na tela, obrigando a fechar tudo pra
   enxergar o conteúdo. Camadas, da mais externa pra mais interna:
   1000 modais comuns → 1050 #modal-loc-hist (resumo/lista secundária) →
   1060 #modal-evento-detalhes (detalhe de evento, pode abrir sobre o
   anterior) → 1070 #modal-evento / #modal-ferias (formulário de edição,
   pode abrir sobre qualquer um dos anteriores — ex.: "Editar" dentro do
   resumo do dia ou dentro de "Todas as Férias") → 1080
   #modal-calendario-periodo (seletor de datas, sempre o mais "de cima",
   já que abre de dentro do formulário de evento/férias). */
#modal-loc-hist { z-index: 1050; }
#modal-evento-detalhes { z-index: 1060; }
#modal-evento, #modal-ferias { z-index: 1070; }
#modal-calendario-periodo { z-index: 1080; }

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

.modal-large {
    max-width: 900px;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 22px;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s;
}

.close:hover {
    color: var(--dark);
}

.modal form,
.modal-body {
    padding: 25px;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

/* FIX (pedido do usuário): a regra acima ("input" genérico) também pegava
   checkbox/radio dentro de qualquer .form-group, esticando eles pra
   width:100% — daí o quadradinho enorme e afastado do texto do lado (visto
   em "Admissão desconhecida" e "Manter nos controles de férias/eventos
   mesmo inativo", mas valia pra QUALQUER checkbox dentro de um form-group
   no sistema todo, não só essas duas telas). Restaura o tamanho natural do
   controle e alinha ele com o texto do label. */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0 6px 0 0;
    vertical-align: middle;
}

.form-group label:has(input[type="checkbox"]),
.form-group label:has(input[type="radio"]) {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 10px;
    padding: 10px;
    background: #f8d7da;
    border-radius: 6px;
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ===== ITEM GROUP (MATERIAIS) ===== */
.item-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
}

.btn-remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* ===== COLABORADORES ===== */
#colaboradores-view-container {
    min-height: 400px;
    position: relative;
}

/* Lista de Colaboradores */
.colaboradores-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.colab-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}

.colab-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.colab-card-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.colab-foto {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.colab-foto img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.colab-info {
    flex: 1;
}

.colab-nome {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.colab-cargo {
    font-size: 13px;
    color: #6c757d;
}

.colab-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-colab {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.btn-colab-ferias {
    background: #28a745;
}

.btn-colab-evento {
    background: #ffc107;
    color: #333;
}

.btn-colab-detalhes {
    background: #0078d4;
}

/* Organograma */
.organograma-container {
    padding: 20px;
    overflow-x: auto;
}

.organograma-turno {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.organograma-turno h3 {
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

.org-tree {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.org-level {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.org-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    min-width: 180px;
    max-width: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    border: 2px solid transparent;
}

.org-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.org-card-foto {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.org-card-foto img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.org-card-nome {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.org-card-cargo {
    font-size: 13px;
    color: #6c757d;
    background: var(--light);
    padding: 4px 8px;
    border-radius: 12px;
}

.org-card.chefe {
    border-color: #ff6b6b;
}

.org-card.engenheiro {
    border-color: #4ecdc4;
}

/* Eventos Ativos Sidebar */
#eventos-ativos-sidebar {
    position: fixed;
    top: 120px;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-height: 250px;
    background: white;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    overflow-y: auto;
    z-index: 1000;
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

#eventos-ativos-sidebar h3 {
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

.evento-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
}

.evento-tipo {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 5px;
}

.evento-colaborador {
    font-size: 12px;
    color: #6c757d;
}

.evento-datas {
    font-size: 11px;
    color: #888;
}

/* Períodos de Férias */
.periodo-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary);
}

.periodo-group h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

/* View Mode Buttons */
.btn-view-mode.active {
    background: var(--primary) !important;
    color: white !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ===== RESPONSIVE ===== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

/* Garantir que todos os status tenham estilo consistente */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

/* ===== CORREÇÃO 3: COLABORADORES - ORGANOGRAMA ===== */

/* Container principal do organograma */
.organograma-container {
    padding: 20px;
    overflow-x: auto;
    width: 100%;
}

.organograma-turno {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.organograma-turno h3 {
    margin-bottom: 25px;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    font-size: 20px;
}

/* Árvore hierárquica - layout vertical */
.org-tree {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

/* Cada nível da hierarquia */
.org-level {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
}

/* Cards dos colaboradores no organograma */
.org-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    min-width: 180px;
    max-width: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    border: 2px solid transparent;
    position: relative;
}

.org-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.org-card-foto {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 3px solid #e0e0e0;
}

.org-card-foto img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.org-card-nome {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.org-card-cargo {
    font-size: 13px;
    color: #6c757d;
    background: var(--light);
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
}

/* Hierarquia visual por cargo */
.org-card.chefe {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #fff 0%, #ffe5e5 100%);
}

.org-card.engenheiro {
    border-color: #4ecdc4;
    background: linear-gradient(135deg, #fff 0%, #e5f9f8 100%);
}

.org-card.sgm {
    border-color: #95a5a6;
}

.org-card.tmpo,
.org-card.lmi {
    border-color: #3498db;
}

.org-card.omm,
.org-card.ome {
    border-color: #9b59b6;
}

/* ===== CORREÇÃO 4: EVENTOS ATIVOS SIDEBAR ===== */

#eventos-ativos-sidebar h3 {
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    color: var(--primary);
}

.evento-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
    transition: all 0.3s;
}

.evento-item:hover {
    background: #e9ecef;
    transform: translateX(-5px);
}

.evento-tipo {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 5px;
}

.evento-colaborador {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 3px;
}

.evento-datas {
    font-size: 11px;
    color: #888;
}

/* ===== CORREÇÃO 5: MODAIS - EVITAR SOBREPOSIÇÃO ===== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    /* ✅ Modal padrão */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    /* ✅ Permite scroll no modal */
}

/* Modal de detalhes com z-index maior */
#modal-colab-detalhes {
    z-index: 1100;
    /* ✅ Fica acima do modal de edição */
}

/* ✅ Seletor de período (calendário) e Gerenciar Feriados precisam ficar
   acima de QUALQUER outro modal — inclusive dos que são criados
   dinamicamente via JS (ex.: "Solicitar Férias", que é recriado no fim do
   <body> a cada abertura e por isso ficaria por cima na ordem do DOM se
   todos usassem o mesmo z-index padrão). */
#modal-calendario-periodo {
    z-index: 1200;
}

#modal-feriados {
    z-index: 1190;
}

/* Quando modal de detalhes está aberto, fecha outros modais */
#modal-colab-detalhes.active~.modal.active {
    display: none;
}

/* ===== CORREÇÃO 6: BOTÕES DE VIEW MODE (Colaboradores) ===== */

.btn-view-mode {
    position: relative;
    transition: all 0.3s;
}

.btn-view-mode.active {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

.btn-view-mode.active::after {
    content: '✓';
    margin-left: 5px;
    font-weight: bold;
}

/* ===== CORREÇÃO 7: LISTA DE COLABORADORES ===== */

.colaboradores-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    /* ✅ Espaço para não colar no rodapé */
}

.colab-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}

.colab-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ===== CORREÇÃO 9: ANIMAÇÕES SUAVES ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== CORREÇÃO 10: ESTADO VAZIO (Empty State) ===== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ===== CORREÇÃO 11: PERÍODOS DE FÉRIAS ===== */

.periodo-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary);
}

.periodo-group h4 {
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 16px;
}

/* ===== CORREÇÃO 12: SCROLL SUAVE ===== */

* {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== FIM DAS CORREÇÕES ===== */

/* ===== v1.0.21 ===== */
/* ===== 1. CALENDÁRIO DE EVENTOS E FÉRIAS ===== */

.calendario-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.calendario-header {
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
    grid-template-columns: auto 1fr auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* ✅ CENTRALIZAÇÃO VERTICAL */
    margin-bottom: 25px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 70px;
    /* ✅ ALTURA MÍNIMA PARA ALINHAMENTO */
}

.calendario-mes {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    min-width: 200px;
    line-height: 1;
}

.calendario-nav {
    z-index: 20;
    /* ✅ Fica acima do sidebar */
    position: relative;

    justify-content: flex-end;

    display: flex;
    gap: 8px;
    align-items: center;
    /* ✅ CENTRALIZAÇÃO VERTICAL */
}

.calendario-nav button {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.calendario-nav button:hover {
    background: var(--light);
    border-color: var(--primary);

    background: var(--light);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    transform: translateY(-2px);

    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendario-dia-semana {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #6c757d;
    padding: 10px 0;
    background: var(--light);
    border-radius: 6px;
}

.calendario-dia {
    min-height: 80px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.calendario-dia:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.calendario-dia.outro-mes {
    opacity: 0.3;
    background: #f8f9fa;
}

.calendario-dia.hoje {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    border: 2px solid var(--primary);
    font-weight: 600;
}

/* ✅ NOVO: marcação visual de feriado no calendário — antes um feriado
   cadastrado não tinha nenhum destaque na grade, só aparecia dentro do
   modal "Gerenciar Feriados". */
.calendario-dia.feriado {
    background: #fffbeb;
    border-color: #fbbf24;
}
.calendario-dia.feriado.hoje {
    background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.calendario-dia-numero {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 5px;
}

.calendario-evento {
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendario-evento.ferias {
    background: #d4edda;
    color: #155724;
}

.calendario-evento.ferias-pendente {
    background: #fff3cd;
    color: #856404;
}

.calendario-evento.evento {
    background: #cce5ff;
    color: #004085;
}

.calendario-legenda {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.calendario-legenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.calendario-legenda-cor {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* ===== AGENDA (versão em lista do calendário para telas pequenas) =====
   Escondida por padrão (desktop usa a grade .calendario-grid); a media
   query mobile troca a exibição das duas (ver final do arquivo). */
.calendario-agenda {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.agenda-dia {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.agenda-dia:active {
    background: #f4f7fb;
}

.agenda-dia.hoje {
    border-color: var(--primary);
    background: rgba(0, 120, 212, 0.06);
}

.agenda-dia.feriado {
    border-left: 4px solid #f59e0b;
}

.agenda-dia-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    flex-shrink: 0;
}

.agenda-dia-numero {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.1;
}

.agenda-dia.hoje .agenda-dia-numero {
    color: var(--primary);
}

.agenda-dia-semana {
    font-size: 10px;
    text-transform: uppercase;
    color: #6c757d;
}

.agenda-dia-eventos {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.agenda-evento {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    color: white;
    overflow: hidden;
    /* v3.56.4: texto longo quebra em linhas em vez de ser cortado com "..." */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.agenda-evento.feriado {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.agenda-dia-vazio {
    font-size: 12px;
    color: #adb5bd;
    padding: 4px 0;
}

#calendario-view {
    margin-right: 340px;
}

/* ===== 2. PAINEL DE APROVAÇÃO DE FÉRIAS ===== */

.ferias-pendentes-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.ferias-pendentes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.ferias-pendentes-header h3 {
    font-size: 18px;
    color: var(--primary);
}

.badge-count {
    background: #ffc107;
    color: #333;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ferias-card {
    background: var(--light);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
    transition: all 0.3s;
}

.ferias-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ferias-card.aprovada {
    border-left-color: #28a745;
    background: #d4edda;
}

.ferias-card.rejeitada {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.ferias-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ferias-card-colaborador {
    font-weight: 600;
    font-size: 16px;
}

.ferias-card-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ferias-card-status.planejada {
    background: #fff3cd;
    color: #856404;
}

.ferias-card-status.aprovada {
    background: #d4edda;
    color: #155724;
}

.ferias-card-status.rejeitada {
    background: #f8d7da;
    color: #721c24;
}

.ferias-card-periodos {
    margin: 10px 0;
    font-size: 14px;
}

.ferias-card-periodo {
    margin-bottom: 5px;
    color: #495057;
}

.ferias-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.btn-aprovar {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-aprovar:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-rejeitar {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-rejeitar:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-editar-ferias {
    background: #ffc107;
    color: #333;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-editar-ferias:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

/* ===== 3. ORGANOGRAMA MELHORADO ===== */

.organograma-container-v2 {
    padding: 30px;
    background: var(--light);
    border-radius: 12px;
    overflow-x: auto;
}

.organograma-turno-v2 {
    margin-bottom: 50px;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.organograma-turno-v2 h3 {
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 22px;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.org-level-v2 {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    flex-direction: row !important;
    /* ✅ Força horizontal */
    align-items: flex-start;
}

.org-tree-v2 {
    display: flex;
    flex-direction: column;
    /* Vertical para níveis */
    gap: 40px;
    align-items: center;
    width: 100%;
}

.org-card-v2 {
    background: white;
    border-radius: 12px;
    padding: 20px;
    min-width: 200px;
    max-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    border: 3px solid transparent;
    position: relative;
}

.org-card-v2:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.org-card-v2::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    width: 2px;
    height: 40px;
    background: #dee2e6;
}

.org-card-v2.raiz::before {
    display: none;
}

.org-card-foto-v2 {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border: 4px solid #e0e0e0;
    overflow: hidden;
}

.org-card-foto-v2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-card-nome-v2 {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.org-card-cargo-v2 {
    font-size: 13px;
    color: white;
    background: var(--primary);
    padding: 5px 12px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
}

.org-card-info-v2 {
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
}

/* Cores por cargo */
.org-card-v2.chefe {
    border-color: #ff6b6b;
}

.org-card-v2.chefe .org-card-cargo-v2 {
    background: #ff6b6b;
}

.org-card-v2.engenheiro {
    border-color: #4ecdc4;
}

.org-card-v2.engenheiro .org-card-cargo-v2 {
    background: #4ecdc4;
}

.org-card-v2.sgm {
    border-color: #95a5a6;
}

.org-card-v2.sgm .org-card-cargo-v2 {
    background: #95a5a6;
}

.org-card-v2.tmpo,
.org-card-v2.lmi {
    border-color: #3498db;
}

.org-card-v2.tmpo .org-card-cargo-v2,
.org-card-v2.lmi .org-card-cargo-v2 {
    background: #3498db;
}

.org-card-v2.omm,
.org-card-v2.ome {
    border-color: #9b59b6;
}

.org-card-v2.omm .org-card-cargo-v2,
.org-card-v2.ome .org-card-cargo-v2 {
    background: #9b59b6;
}

.btn-add-subordinado {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
}

/* ===== 4. EVENTOS ATIVOS - CORRIGIDO ===== */

/* Ajuste para não sobrepor botões */
.colaboradores-lista,
.organograma-container {
    margin-right: 360px;
    /* Espaço para o sidebar */
}

#eventos-ativos-sidebar h3 {
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    color: var(--primary);
}

/* ===== 5. PAINEL DE INATIVOS ===== */

.inativos-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    border: 2px dashed #dee2e6;
}

.inativos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.inativos-header h3 {
    font-size: 18px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-toggle-inativos {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-toggle-inativos:hover {
    background: #5a6268;
}

.inativos-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.inativo-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #6c757d;
    opacity: 0.8;
}

.inativo-card:hover {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== 6. TABS DE NAVEGAÇÃO ===== */

.colab-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.colab-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.colab-tab:hover {
    color: var(--primary);
}

.colab-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== BOTÕES DE NAVEGAÇÃO DO CALENDÁRIO ===== */
.calendario-nav button {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 20;
    /* ✅ Garantir cliques */
}

/* ===== SELETOR DE MÊS E ANO ===== */
.calendario-controles {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.calendario-select {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    height: 38px;
    min-width: 110px;
    padding: 8px 12px;
    transition: all 0.3s;
    z-index: 20;
}

.calendario-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
    outline: none;
}

/* ===== RESPONSIVO ===== */

#eventos-ativos-sidebar.minimizado {
    max-height: 50px;
    overflow: hidden;
}

.btn-toggle-sidebar {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
}

/* Sidebar de eventos - canto inferior direito */

#eventos-ativos-sidebar.minimizado {
    max-height: 50px;
    overflow: hidden;
}

#eventos-ativos-sidebar.minimizado .eventos-ativos-content {
    display: none;
}

.btn-toggle-sidebar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-toggle-sidebar:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.organograma-container-v2 {
    padding: 30px;
    background: var(--light);
    border-radius: 12px;
    overflow-x: auto;
}

.organograma-turno-v2 {
    margin-bottom: 50px;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.org-tree-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.org-nivel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.org-nivel-label {
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.org-nivel-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.org-card-v2 {
    background: white;
    border-radius: 12px;
    padding: 20px;
    min-width: 200px;
    max-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    border: 3px solid transparent;
    position: relative;
}

.org-card-v2:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Card de superior em outro turno */
.org-card-outro-turno {
    opacity: 0.6;
    max-width: 150px;
    min-width: 120px;
    padding: 10px;
    background: #f8f9fa !important;
    border: 2px dashed #dee2e6 !important;
    margin-top: -20px;
    transform: scale(0.85);
}

.org-card-outro-turno:hover {
    opacity: 0.9;
    transform: scale(0.9);
}

/* Períodos individuais */
.ferias-card-periodo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
}

.ferias-card-periodo-info {
    flex: 1;
}

.ferias-card-periodo-acoes {
    display: flex;
    gap: 5px;
}

.btn-periodo {
    padding: 5px 10px;
    font-size: 11px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-periodo.aprovar {
    background: #28a745;
    color: white;
}

.btn-periodo.aprovar:hover {
    background: #218838;
}

.btn-periodo.rejeitar {
    background: #dc3545;
    color: white;
}

.btn-periodo.rejeitar:hover {
    background: #c82333;
}

/* ✅ BOTÃO EDITAR: Canto direito, abaixo do topo */
.colab-card {
    position: relative;
    padding: 20px;
}

.colab-card-edit-btn {
    position: absolute;
    top: 50px;
    /* ✅ Abaixo do topo do card */
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

.colab-card-edit-btn:hover {
    background: #005a9e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.colab-card-edit-btn:active {
    transform: translateY(0);
}

/* ===== RESUMO DASHBOARD ===== */

.resumo-dashboard {
    padding: 20px;
}

.resumo-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 48px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--light);
}

.stat-primary .stat-icon {
    background: #e7f3ff;
}

.stat-warning .stat-icon {
    background: #fff8e1;
}

.stat-success .stat-icon {
    background: #e8f5e9;
}

.stat-info .stat-icon {
    background: #f3e5f5;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
}

.resumo-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.resumo-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.resumo-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, #005a9e 100%);
    color: white;
    padding: 20px;
    border-bottom: 3px solid var(--primary-hover);
}

.resumo-card-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resumo-card-body {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.resumo-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.evento-resumo-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    background: var(--light);
    border-left: 4px solid #dee2e6;
    transition: all 0.3s;
}

.evento-resumo-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.evento-resumo-item.evento-hoje {
    background: #fff3cd;
    border-left-color: #ffc107;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

.evento-resumo-item.evento-semana-atual {
    background: #e7f3ff;
    border-left-color: var(--primary);
}

.evento-resumo-item.evento-treinamento {
    border-left-color: #9b59b6;
}

.evento-resumo-item.evento-ferias {
    border-left-color: #28a745;
}

.evento-resumo-item.evento-folga {
    border-left-color: #17a2b8;
}

.evento-resumo-item.evento-atestado {
    border-left-color: #dc3545;
}

.evento-resumo-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    flex-shrink: 0;
}

.evento-resumo-info {
    flex: 1;
    min-width: 0; /* v3.56.4: permite quebrar nomes longos de tipo (ex.: tipo digitado em "Outros") */
    overflow-wrap: anywhere;
    word-break: break-word;
}

.evento-resumo-tipo {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 5px;
}

.evento-resumo-colaborador {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.evento-resumo-data {
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-hoje {
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-semana {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.evento-resumo-obs {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

.resumo-section {
    margin-bottom: 30px;
}

.resumo-section h4 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.resumo-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-item {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    gap: 10px;
}

.chart-label {
    font-size: 14px;
    font-weight: 500;
}

.chart-bar-container {
    background: #e9ecef;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.chart-manha {
    background: linear-gradient(90deg, #ffd700 0%, #ffa500 100%);
}

.chart-tarde {
    background: linear-gradient(90deg, #4fc3f7 0%, #29b6f6 100%);
}

.chart-noite {
    background: linear-gradient(90deg, #7e57c2 0%, #5e35b1 100%);
}

.chart-value {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-align: right;
}

.resumo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resumo-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--light);
    border-radius: 6px;
}

.resumo-list-label {
    font-size: 14px;
    color: #495057;
}

.resumo-list-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    background: white;
    padding: 4px 12px;
    border-radius: 12px;
}

/* ===== ORGANOGRAMA MULTI-TURNO ===== */

.organograma-multi-turno {
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.organograma-header {
    text-align: center;
    margin-bottom: 40px;
}

.organograma-header h2 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 10px;
}

.organograma-subtitle {
    font-size: 14px;
    color: #6c757d;
}

.org-nivel-completo {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.org-nivel-titulo {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 25px;
}

.org-nivel-icon {
    font-size: 36px;
}

.org-nivel-info {
    flex: 1;
}

.org-nivel-nome {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    display: block;
    margin-bottom: 5px;
}

.org-nivel-count {
    font-size: 13px;
    color: #6c757d;
}

.org-nivel-turnos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.org-turno-secao {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.org-turno-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.org-turno-icon {
    font-size: 24px;
}

.org-turno-label {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
}

.org-turno-count {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.org-turno-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.org-card-novo {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.org-card-novo:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.org-card-foto-novo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.org-card-foto-novo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-card-avatar {
    font-size: 24px;
}

.org-card-nome-novo {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    flex: 1;
}

.org-card-cargo-novo {
    font-size: 11px;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.org-card-superior {
    font-size: 11px;
    color: #6c757d;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-turno-diferente {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
}

/* ===== ORGANOGRAMA COM LINHAS HIERÁRQUICAS ===== */

.organograma-container-novo {
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.organograma-controles {
    margin-bottom: 30px;
    text-align: center;
}

.organograma-controles h2 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 20px;
}

.org-turno-filtros {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-turno-filtro {
    padding: 10px 20px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-turno-filtro:hover {
    border-color: var(--primary);
    background: #e7f3ff;
}

.btn-turno-filtro.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.org-hierarquia {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.org-nivel-hierarquico {
    position: relative;
    margin-bottom: 40px;
}

.org-linha-vertical {
    width: 3px;
    height: 40px;
    background: linear-gradient(180deg, #dee2e6 0%, #adb5bd 100%);
    margin: 0 auto 20px;
    border-radius: 2px;
}

.org-nivel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 6px solid var(--primary);
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.org-nivel-icon-novo {
    font-size: 32px;
}

.org-nivel-label-novo {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.org-nivel-count-novo {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.org-cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.org-linha-horizontal {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #dee2e6 0%, #adb5bd 50%, #dee2e6 100%);
    flex-shrink: 0;
}

.org-card-hierarquico {
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 220px;
    border: 3px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.org-card-hierarquico:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.org-card-foto-hierarquico {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
    border: 4px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
}

.org-card-foto-hierarquico img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-avatar {
    font-size: 36px;
}

.org-card-info-hierarquico {
    width: 100%;
}

.org-card-nome-hierarquico {
    font-weight: 700;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 8px;
}

.org-card-cargo-hierarquico {
    font-size: 11px;
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: inline-block;
}

.org-card-turno-hierarquico {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

.org-card-superior-hierarquico {
    font-size: 11px;
    color: #6c757d;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    margin-top: 10px;
}

.badge-turno-dif {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    margin-left: 5px;
}

/* ===== CARD STATS COM HOVER ===== */

.stat-card {
    position: relative;
}

.stat-arrow {
    font-size: 24px;
    color: #dee2e6;
    transition: all 0.3s;
}

.stat-card:hover .stat-arrow {
    color: var(--primary);
    transform: translateX(5px);
}

/* ===== MÓDULO EMP ===== */

.emp-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #17a2b8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.emp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.emp-card.emp-atrasado {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.emp-card-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
}

.emp-foto {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    flex-shrink: 0;
}

.emp-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.emp-info {
    flex: 1;
}

.emp-nome {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.emp-cargo {
    font-size: 13px;
    color: #6c757d;
}

.emp-status {
    text-align: right;
}

.emp-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 5px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.emp-data-ultimo,
.emp-data-proximo {
    font-size: 12px;
    color: #6c757d;
    margin-top: 3px;
}

.emp-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    font-size: 13px;
    color: #6c757d;
}

.btn-emp-agendar {
    padding: 8px 16px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-emp-agendar:hover {
    background: #138496;
}

.evento-resumo-item.evento-emp {
    border-left-color: #17a2b8;
}

/* ===== CALENDÁRIO - LAYOUT MELHORADO ===== */

.calendario-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.calendario-nav button {
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.calendario-dia-semana {
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #495057;
    padding: 12px 0;
    background: var(--light);
    border-radius: 6px;
}

.calendario-dia {
    min-height: 100px;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.calendario-dia:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.1);
    transform: translateY(-2px);
}

.calendario-dia.outro-mes {
    opacity: 0.4;
    background: #f8f9fa;
}

.calendario-dia.hoje {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    border: 2px solid var(--primary);
}

.calendario-dia.feriado {
    background: #fffbeb;
    border-color: #fbbf24;
}
.calendario-dia.feriado.hoje {
    background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.calendario-dia-numero {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--dark);
}

.calendario-evento {
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.calendario-legenda {
    display: flex;
    gap: 25px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.calendario-legenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.calendario-legenda-cor {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* ===== GERENCIAMENTO DE TIPOS DE EVENTOS ===== */

.tipo-evento-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s;
}

.tipo-evento-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tipo-evento-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border-radius: 8px;
}

.tipo-evento-info {
    flex: 1;
    /* ✅ NOVO: sem isso, texto longo (nome do tipo de evento) força a linha
       toda a ficar mais larga que a tela em vez de quebrar normalmente
       (em espaços) dentro do espaço disponível — comum em tela pequena. */
    min-width: 0;
}

.tipo-evento-nome {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 3px;
}

.tipo-evento-meta {
    font-size: 12px;
    color: #6c757d;
}

.tipo-evento-badge {
    padding: 4px 12px;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tipo-evento-acoes {
    display: flex;
    gap: 8px;
}

.btn-tipo-acao {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-tipo-acao:hover {
    transform: scale(1.1);
}

.btn-tipo-acao.btn-deletar {
    background: #dc3545;
}

.tipo-personalizado {
    border-left: 4px solid var(--primary);
}

.tipo-padrao {
    border-left: 4px solid #6c757d;
    background: #f8f9fa;
}

/* ===== TIPOS DE EVENTOS - ESTADOS ===== */

.tipo-evento-item.tipo-desativado {
    opacity: 0.6;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.btn-tipo-acao.btn-desativar {
    background: #ffc107;
}

.btn-tipo-acao.btn-desativar:hover {
    background: #e0a800;
}

.btn-tipo-acao.btn-ativar {
    background: #28a745;
}

.btn-tipo-acao.btn-ativar:hover {
    background: #218838;
}

.btn-tipo-acao.btn-deletar {
    background: #dc3545;
}

.btn-tipo-acao.btn-deletar:hover {
    background: #c82333;
}

/* ===== CALENDÁRIO - HEADER MELHORADO ===== */

.calendario-select:hover {
    border-color: var(--primary);
}

.calendario-nav button {
    padding: 10px 16px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== MODAL EXPORTAÇÃO PDF ===== */

.modal-exportacao-pdf {
    padding: 0;
    max-width: 600px;
}

.export-header {
    background: linear-gradient(135deg, var(--primary) 0%, #005a9e 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-header h3 {
    margin: 0;
    font-size: 22px;
}

.btn-close-export {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-export:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

#form-exportar-pdf {
    padding: 30px;
}

.export-section {
    margin-bottom: 30px;
}

.export-section h4 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.export-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
    font-weight: 500;
}

.export-checkbox-label:hover {
    background: #e7f3ff;
}

.export-checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.export-checkbox-label input[type="checkbox"]:checked+.checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.export-checkbox-label input[type="checkbox"]:checked+.checkbox-custom::after {
    content: "✓";
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.export-preview {
    padding: 15px 20px;
    background: #e7f3ff;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin-top: 20px;
    display: flex;
    gap: 15px;
    align-items: start;
}

.preview-icon {
    font-size: 24px;
}

.preview-content {
    flex: 1;
    font-size: 14px;
}

.export-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
    margin-top: 30px;
}

/* ===== CALENDÁRIO - HEADER ALINHADO ===== */

.calendario-nav button {
    padding: 8px 14px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== MODAL EXPORTAÇÃO PDF ===== */

.modal-exportacao-pdf {
    max-width: 550px;
}

.export-header {
    background: linear-gradient(135deg, var(--primary) 0%, #005a9e 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-header h3 {
    margin: 0;
    font-size: 20px;
}

.btn-close-export {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 22px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close-export:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.export-body {
    padding: 25px;
}

.export-section {
    margin-bottom: 25px;
}

.export-section h4 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 15px;
}

.export-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-radio-label,
.export-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.export-radio-label:hover,
.export-checkbox-label:hover {
    background: #e7f3ff;
}

.export-radio-label input,
.export-checkbox-label input {
    display: none;
}

.radio-custom,
.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.checkbox-custom {
    border-radius: 4px;
}

.export-radio-label input:checked+.radio-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.export-radio-label input:checked+.radio-custom::after {
    content: "";
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.export-checkbox-label input:checked+.checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.export-checkbox-label input:checked+.checkbox-custom::after {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.export-preview {
    padding: 12px 15px;
    background: #e7f3ff;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: start;
    font-size: 13px;
}

.preview-icon {
    font-size: 20px;
}

.export-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--border);
}

/* ===== MODAL EXPORTAÇÃO PDF - REDESIGN ===== */

.modal-exportacao-pdf {
    max-width: 650px;
}

.export-header {
    background: linear-gradient(135deg, var(--primary) 0%, #005a9e 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-header h3 {
    margin: 0;
    font-size: 20px;
}

.btn-close-export {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 22px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close-export:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.export-body {
    padding: 25px;
}

/* ✅ SEÇÃO PRINCIPAL (PERÍODO) */
.export-section-primary {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    margin-bottom: 25px;
}

.section-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.section-content {
    flex: 1;
}

.section-content h4 {
    margin: 0 0 12px 0;
    color: var(--primary);
    font-size: 16px;
}

.date-inputs {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
}

.date-input-group input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.date-separator {
    font-size: 13px;
    color: #6c757d;
    margin-top: 20px;
}

/* ✅ GRID DE OPÇÕES */
.export-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.export-option-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
}

.export-option-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.option-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.option-icon {
    font-size: 20px;
}

.option-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.option-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.choice-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.choice-label:hover {
    background: #e7f3ff;
}

.choice-label input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.choice-text small {
    font-size: 11px;
    color: #6c757d;
}

/* ✅ PRÉVIA */
.export-preview {
    padding: 12px 15px;
    background: #fff3cd;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    display: flex;
    gap: 12px;
    align-items: start;
    font-size: 13px;
}

.preview-icon {
    font-size: 20px;
}

.export-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--border);
    background: #f8f9fa;
    /* ✅ CORRIGIDO (pedido do usuário): sem isso, "Cancelar" + "📥 Gerar PDF"
       vazavam pra fora do modal em tela estreita (sem quebrar linha nem
       encolher). */
    flex-wrap: wrap;
}

/* ===== SELETORES DE PERÍODO ===== */

.period-selectors {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

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

.period-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
}

.period-inputs {
    display: flex;
    gap: 8px;
}

.period-select {
    flex: 1;
    /* ✅ CORRIGIDO (pedido do usuário): sem isso, o texto do mês
       ("Setembro") definia uma largura mínima que o navegador respeitava
       mesmo com flex:1, então o select do ANO era espremido pra fora do
       cartão em tela estreita. */
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.period-separator {
    font-size: 13px;
    color: #6c757d;
    margin-top: 28px;
    flex-shrink: 0;
}

.hint {
    display: block;
    font-size: 11px;
    color: #6c757d;
    margin-top: 6px;
}



/* ========================================
   MÓDULO LOCALIDADES
   ======================================== */

/* --- Containers principais --- */
#localidades-content {
    padding: 0;
}

#localidades-tab-content {
    padding: 25px;
    background: #f5f5f5;
    min-height: calc(100vh - 200px);
}

/* --- Abas --- */
.tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 25px;
}

.tabs .tab {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.tabs .tab:hover {
    color: var(--primary);
    background: rgba(0, 120, 212, 0.05);
}

.tabs .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tabs .tab span {
    margin-left: 5px;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* --- Mapa SVG --- */
.mapa-container {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
    min-height: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mapa-svg {
    width: 100%;
    height: auto;
    cursor: grab;
    transition: transform 0.3s;
}

.mapa-svg:active {
    cursor: grabbing;
}

/* Linhas do metrô */
.linha-metro {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s;
}

.linha-metro:hover {
    stroke-width: 12;
    filter: brightness(1.3) drop-shadow(0 0 10px currentColor);
}

/* Estações */
.estacao {
    cursor: pointer;
    transition: all 0.3s;
}

.estacao-circle {
    fill: white;
    stroke: #333;
    stroke-width: 2;
    transition: all 0.3s;
}

.estacao:hover .estacao-circle {
    r: 10;
    fill: #FFD700;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px #FFD700);
}

.estacao-label {
    fill: white;
    font-size: 11px;
    font-weight: 600;
    font-family: Arial, sans-serif;
    pointer-events: none;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

/* Badge de quantidade de equipamentos */
.estacao-badge {
    fill: #DC3545;
    stroke: white;
    stroke-width: 2;
}

.estacao-badge-text {
    fill: white;
    font-size: 10px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
}

/* Controles do mapa */
.mapa-controles {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.btn-zoom {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-zoom:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Legenda */
.mapa-legenda {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 280px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.mapa-legenda h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #555;
}

.legenda-item:last-child {
    margin-bottom: 0;
}

.legenda-cor {
    width: 30px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- Filtros --- */
.filtros-localidades {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filtros-localidades select,
.filtros-localidades input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.filtros-localidades select:focus,
.filtros-localidades input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* --- Cards de Instalação --- */
.instalacoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.instalacao-card {
    background: white;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.instalacao-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.instalacao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.badge-linha {
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.patrimonio-destaque {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.instalacao-body h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.instalacao-info {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.instalacao-info strong {
    color: var(--dark);
    min-width: 90px;
}

.instalacao-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.instalacao-actions .btn {
    flex: 1;
    min-width: 100px;
    font-size: 12px;
    padding: 8px 12px;
}

/* --- Cards SSL (Manutenção) --- */
.manutencao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.ssl-card {
    background: white;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border-left: 4px solid #6c757d;
}

.ssl-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.ssl-card.status-solicitado {
    border-left-color: #FFC107;
}

.ssl-card.status-enviado {
    border-left-color: #0078D4;
}

.ssl-card.status-devolvido {
    border-left-color: #28A745;
}

.ssl-card.status-baixado {
    border-left-color: #DC3545;
}

.ssl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.ssl-numero {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
}

.badge-status {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-status.solicitado {
    background: #FFF3CD;
    color: #856404;
}

.badge-status.enviado {
    background: #CCE5FF;
    color: #004085;
}

.badge-status.devolvido {
    background: #D4EDDA;
    color: #155724;
}

.badge-status.baixado {
    background: #F8D7DA;
    color: #721C24;
}

/* --- Estoque --- */
.estoque-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.estoque-grupo {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.estoque-grupo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.estoque-grupo-titulo {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.estoque-responsavel {
    font-size: 13px;
    color: #6c757d;
}

.estoque-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.estoque-item {
    background: #F8F9FA;
    border: 2px solid #DEE2E6;
    border-radius: 8px;
    padding: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.estoque-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

.estoque-item-patrimonio {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.estoque-item-nome {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.estoque-item-actions {
    display: flex;
    gap: 6px;
}

.estoque-item-actions .btn {
    flex: 1;
    font-size: 11px;
    padding: 6px 10px;
}

/* --- Timeline de Histórico --- */
.timeline-historico {
    position: relative;
    padding-left: 35px;
    margin-top: 20px;
}

.timeline-historico::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), #DEE2E6);
}

.timeline-evento {
    position: relative;
    margin-bottom: 20px;
    padding-left: 15px;
}

.timeline-evento::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
    z-index: 1;
}

.timeline-data {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
    font-weight: 500;
}

.timeline-acao {
    font-size: 14px;
    color: var(--dark);
    font-weight: 500;
}

.timeline-detalhes {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
}

/* --- Fotos --- */
.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.foto-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #DEE2E6;
    transition: all 0.3s;
}

.foto-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-item-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.foto-item:hover .foto-item-remove {
    display: flex;
}

.foto-item-remove:hover {
    background: #DC3545;
    transform: scale(1.1);
}

/* --- Tabelas de Configuração --- */
.config-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.config-tabs .btn {
    border-radius: 6px 6px 0 0;
    border-bottom: 3px solid transparent;
}

.config-tabs .btn.active {
    border-bottom-color: var(--primary);
    background: var(--primary);
    color: white;
}

.config-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-config {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table-config thead {
    background: #F8F9FA;
}

.table-config th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #DEE2E6;
    font-size: 13px;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
}

.table-config td {
    padding: 12px;
    border-bottom: 1px solid #E9ECEF;
    font-size: 14px;
}

.table-config tbody tr {
    transition: all 0.2s;
}

.table-config tbody tr:hover {
    background: #F8F9FA;
}

.sortable-row {
    cursor: move;
}

.sortable-row.dragging {
    opacity: 0.5;
    background: #E9ECEF;
}

.handle-drag {
    cursor: grab;
    color: #CED4DA;
    font-size: 16px;
}

.handle-drag:active {
    cursor: grabbing;
}

/* --- Responsivo --- */






/*
  ╔══════════════════════════════════════════════════════════════════╗
  ║  MÓDULO LOCALIDADES — PARTE 2: CSS                              ║
  ║  Adicionar no seu arquivo de estilos (style.css ou app.css)     ║
  ╚══════════════════════════════════════════════════════════════════╝
*/

/* ─── BARRA DE ABAS ─────────────────────────────────────────────── */
.loc-tabs-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    background: var(--card-bg, #fff);
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.loc-tab {
    background: none;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.loc-tab:hover {
    background: rgba(0, 120, 212, 0.07);
    color: var(--primary);
}

.loc-tab.active {
    background: rgba(0, 120, 212, 0.12);
    color: var(--primary);
    font-weight: 600;
}

.loc-tab-badge {
    background: var(--primary, #0078d4);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 16px;
}

.loc-tabs-spacer {
    flex: 1;
}

.btn-manual-indisponivel {
    background: #fee2e2 !important;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
}

.badge-sem-manual {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 2px 8px;
    margin-left: 6px;
}

.tag-modelo {
    display: inline-block;
    font-size: 12px;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 3px 9px;
}

.linha-com-manual:hover {
    background: #f0fdf4;
}

.nav-item-sair {
    margin-top: 18px;
    color: #fca5a5 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item-sair:hover {
    background: rgba(220, 38, 38, 0.15) !important;
}

.btn-check-manual {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-check-manual:hover {
    background: #dcfce7;
}

#feedback-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

#feedback-fab:hover {
    transform: scale(1.08);
}

#feedback-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc2626;
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}



/* ─── ABAS DENTRO DE EQUIPAMENTOS (Equipamentos / Manuais) ─────────── */
.eqtabs {
    display: flex;
    gap: 4px;
    margin-top: 10px;
}

.eqtab-btn,
.eqview-btn {
    background: none;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-radius: 8px 8px 0 0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.eqtab-btn:hover,
.eqview-btn:hover {
    background: rgba(0, 120, 212, 0.07);
    color: var(--primary);
}

.eqtab-btn.active,
.eqview-btn.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

.eqtab-content {
    padding: 20px;
}

.btn-sm {
    padding: 8px 14px !important;
    font-size: 13px !important;
}

/* ─── CONTEÚDO DAS ABAS ─────────────────────────────────────────── */
.loc-tab-content {
    padding: 20px;
    min-height: calc(100vh - 160px);
    background: #f5f5f5;
}

/* ─── FILTROS ───────────────────────────────────────────────────── */
.loc-filtros {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px;
    background: white;
    border-radius: 10px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.loc-filtros select,
.loc-filtros input {
    flex: 1;
    min-width: 160px;
    padding: 9px 12px;
    border: 1.5px solid #dee2e6;
    border-radius: 7px;
    font-size: 13px;
    background: white;
    transition: border-color 0.2s;
}

.loc-filtros select:focus,
.loc-filtros input:focus {
    outline: none;
    border-color: var(--primary, #0078d4);
}

/* ─── GRID DE CARDS ─────────────────────────────────────────────── */
.loc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.loc-grid.manutencao {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

/* ─── CARD DE INSTALAÇÃO ────────────────────────────────────────── */
.loc-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.25s;
    border-left: 4px solid #ccc;
    position: relative;
}

.loc-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.11);
    transform: translateY(-2px);
}

.loc-card.status-ativo {
    border-left-color: #28A745;
}

.loc-card.status-inativo {
    border-left-color: #6c757d;
}

.loc-card.status-manutencao {
    border-left-color: #FFC107;
}

.loc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #f0f0f0;
}

.loc-card-linha {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.loc-card-patrimonio {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary, #0078d4);
    font-family: monospace;
}

.loc-card-body h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #222;
    font-weight: 600;
}

.loc-card-info {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 5px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.loc-card-info strong {
    color: #333;
    min-width: 80px;
    flex-shrink: 0;
}

.loc-card-actions {
    display: flex;
    gap: 7px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.loc-card-actions .btn {
    flex: 1;
    min-width: 90px;
    font-size: 12px;
    padding: 7px 10px;
}

/* ─── BADGE DE STATUS ───────────────────────────────────────────── */
.badge-loc-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 10px;
    text-transform: uppercase;
}

.badge-loc-status.ativo {
    background: #d4edda;
    color: #155724;
}

.badge-loc-status.inativo {
    background: #e2e3e5;
    color: #383d41;
}

.badge-loc-status.manutencao {
    background: #fff3cd;
    color: #856404;
}

/* ─── CARD SSL (MANUTENÇÃO) ─────────────────────────────────────── */
.ssl-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.25s;
    border-left: 4px solid #ccc;
}

.ssl-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.11);
    transform: translateY(-2px);
}

.ssl-card.ssl-solicitado {
    border-left-color: #FFC107;
}

.ssl-card.ssl-enviado {
    border-left-color: #0078D4;
}

.ssl-card.ssl-devolvido {
    border-left-color: #28A745;
}

.ssl-card.ssl-baixado {
    border-left-color: #DC3545;
}

.ssl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #f0f0f0;
}

.ssl-numero {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.badge-ssl-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}

.badge-ssl-status.solicitado {
    background: #fff3cd;
    color: #856404;
}

.badge-ssl-status.enviado {
    background: #cce5ff;
    color: #004085;
}

.badge-ssl-status.devolvido {
    background: #d4edda;
    color: #155724;
}

.badge-ssl-status.baixado {
    background: #f8d7da;
    color: #721c24;
}

/* ─── ESTOQUE ───────────────────────────────────────────────────── */
.estoque-grupo {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.estoque-grupo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 2px solid #f0f0f0;
}

.estoque-grupo-titulo {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estoque-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.estoque-item {
    background: #f8f9fa;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    padding: 13px;
    transition: all 0.2s;
    cursor: pointer;
}

.estoque-item:hover {
    border-color: var(--primary, #0078d4);
    background: #eef4fb;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 120, 212, 0.13);
}

.estoque-item-pat {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary, #0078d4);
    font-family: monospace;
    margin-bottom: 4px;
}

.estoque-item-nome {
    font-size: 13px;
    color: #444;
    margin-bottom: 8px;
}

.estoque-item-actions {
    display: flex;
    gap: 5px;
}

.estoque-item-actions .btn {
    flex: 1;
    font-size: 11px;
    padding: 5px 8px;
}

/* ─── MAPA ──────────────────────────────────────────────────────── */
.mapa-wrapper {
    position: relative;
    background: #111;
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
    min-height: 600px;
}

.loc-mapa-svg {
    width: 100%;
    height: auto;
    cursor: grab;
    user-select: none;
}

.loc-mapa-svg:active {
    cursor: grabbing;
}

.mapa-linha {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mapa-estacao {
    cursor: pointer;
}

.mapa-estacao-circle {
    fill: white;
    stroke: #444;
    stroke-width: 1.5;
    transition: r 0.2s, fill 0.2s;
}

.mapa-estacao:hover .mapa-estacao-circle {
    fill: #FFD700;
    stroke: white;
    stroke-width: 2.5;
}

.mapa-estacao-label {
    font-family: Arial, sans-serif;
    fill: white;
    font-size: 9px;
    font-weight: 600;
    pointer-events: none;
}

.mapa-estacao-badge {
    fill: #DC3545;
    stroke: white;
    stroke-width: 1.5;
}

.mapa-estacao-badge-txt {
    fill: white;
    font-size: 8px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: middle;
    font-family: Arial, sans-serif;
}

.mapa-controles {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.btn-zoom {
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.btn-zoom:hover {
    background: var(--primary, #0078d4);
    color: white;
    transform: scale(1.1);
}

.mapa-legenda {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 12px 14px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    max-width: 230px;
    z-index: 10;
    font-size: 12px;
}

.mapa-legenda h4 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #444;
}

.legenda-cor {
    width: 24px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ─── TIMELINE / HISTÓRICO ──────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 16px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary, #0078d4), #dee2e6);
}

.timeline-item {
    position: relative;
    margin-bottom: 18px;
    padding-left: 12px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 2.5px solid var(--primary, #0078d4);
    z-index: 1;
}

.timeline-data {
    font-size: 11px;
    color: #999;
    font-weight: 600;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.timeline-acao {
    font-size: 14px;
    color: #222;
    font-weight: 500;
}

.timeline-detalhe {
    font-size: 12px;
    color: #6c757d;
    margin-top: 3px;
}

/* ─── FOTOS GRID ────────────────────────────────────────────────── */
.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.foto-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid #dee2e6;
    transition: all 0.2s;
}

.foto-item:hover {
    border-color: var(--primary);
    transform: scale(1.04);
}

.foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.foto-item:hover .foto-remove {
    display: flex;
}

/* ─── CONFIG MODAL ──────────────────────────────────────────────── */
.config-tabs-bar {
    display: flex;
    gap: 4px;
    padding: 12px 20px 0;
    border-bottom: 2px solid #e0e0e0;
}

.config-tab {
    background: none;
    border: none;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    border-radius: 7px 7px 0 0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.config-tab.active {
    color: var(--primary, #0078d4);
    border-bottom-color: var(--primary, #0078d4);
    background: rgba(0, 120, 212, 0.07);
}

.config-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.config-table thead {
    background: #f8f9fa;
}

.config-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    font-size: 12px;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.4px;
}

.config-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
}

.config-table tbody tr:hover {
    background: #f8f9fa;
}

.config-table td .btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* ─── FORM EXTRAS ───────────────────────────────────────────────── */
.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary, #0078d4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 18px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(0, 120, 212, 0.15);
}

.form-details {
    margin-top: 4px;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 4px;
}

.form-details summary {
    outline: none;
}

.form-details[open] {
    background: #fafafa;
}

/* ─── MAPA TOOLTIP ──────────────────────────────────────────────── */
.mapa-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 12px;
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
    display: none;
    font-family: Arial, sans-serif;
}

/* ─── MODAL TAMANHOS ────────────────────────────────────────────── */
.modal-xl .modal-content {
    max-width: 900px;
    width: 95vw;
}

/* ─── EMPTY STATE ───────────────────────────────────────────────── */
.loc-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.loc-empty .loc-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.loc-empty p {
    font-size: 16px;
    margin: 0;
}

/* ─── RESPONSIVO ────────────────────────────────────────────────── */




.mapa-estacao-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 80px;
    min-height: 50px;
    background: #1e1e1e;
    border: 2px solid #555;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px 6px;
}

.mapa-estacao-btn:hover {
    background: #2d2d2d;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mapa-estacao-btn.tem-inst {
    background: #1a2a1a;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}

.mapa-est-nome {
    font-size: 9px;
    color: #ccc;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
}

.mapa-est-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #111;
}

.mapa-est-g .mapa-est-circle {
    transition: r 0.15s, fill 0.15s;
}

.mapa-est-g:hover .mapa-est-circle {
    r: 9;
    fill: #FFD700 !important;
}

#loc-grid-manutencao {
    display: block !important;
}

.est-row {
    transition: background 0.15s;
}

.est-row:hover {
    background: #f8fafc !important;
}

/* Hover do estoque sem onmouseout */
.est-card-loc summary {
    user-select: none;
}

/* Animação ao abrir details */
details>div,
details>.loc-loc-cards {
    animation: locFadeIn 0.18s ease;
}

@keyframes locFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove marcador padrão do <details> em todos browsers */
details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

/* ── BARRA DE FILTROS REDESENHADA ── */
.filter-bar {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.filter-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}

.filter-bar .filter-group label {
    font-size: 11px;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0;
}

.filter-bar .filter-group input,
.filter-bar .filter-group select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.filter-bar .filter-group input:focus,
.filter-bar .filter-group select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.15);
}

.filter-bar .filter-actions {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
}

.filter-bar .filter-separator {
    width: 100%;
    height: 0;
    border-top: 1px dashed var(--border);
    margin: 2px 0;
}

/* Resumo de resultados melhorado */
.results-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #e7f3ff;
    border: 1px solid #b8d8f8;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 14px;
    font-size: 13px;
}

.results-bar .results-count {
    font-weight: 700;
    color: #0078d4;
    font-size: 15px;
}

.results-bar .filter-tag {
    background: white;
    border: 1px solid #b8d8f8;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    color: #004085;
    display: flex;
    align-items: center;
    gap: 5px;
}

.results-bar .filter-tag-remove {
    cursor: pointer;
    color: #004085;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
}

.results-bar .filter-tag-remove:hover {
    opacity: 1;
}

/* Dropdown customizado melhorado */
.custom-dropdown .dropdown-toggle {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 130px;
    transition: border-color 0.2s;
}

.custom-dropdown .dropdown-toggle:hover {
    border-color: var(--primary);
}

.custom-dropdown.open .dropdown-toggle {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.15);
}

.dropdown-label.has-selection {
    color: var(--primary);
    font-weight: 600;
}

/* ── Padronização geral dos módulos ─────────────────────── */

/* Rótulos de filtro maiúsculos e compactos */
.filter-bar .filter-group label {
    font-size: 10px;
    font-weight: 700;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    display: block;
}

/* Input e select com altura uniforme */
.filter-bar input[type="text"],
.filter-bar input[type="date"],
.filter-bar select {
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    line-height: 36px;
}

/* Botão limpar filtros padronizado */
.filter-bar .filter-actions .btn {
    height: 36px;
    padding: 0 14px;
    font-size: 12px;
    white-space: nowrap;
}

/* Separador entre grupos de filtros */
.filter-bar .filter-sep {
    width: 1px;
    height: 28px;
    background: #e0e0e0;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 4px;
}

/* Contador flutuante de resultados */
.results-floating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #0078d4;
    background: #e7f3ff;
    border: 1px solid #b8d8f8;
    border-radius: 20px;
    padding: 3px 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* ── Manual: responsivo ─────────────────────────────────── */


/* Animação de atualização do Dashboard */
@keyframes dashFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#dashboard-container>div {
    animation: dashFade 0.3s ease;
}

/* Dashboard responsivo */

/* ===== FILTROS COLAPSÁVEIS NO MOBILE (reutilizável em qualquer tela) =====
   Uso: envolva a barra de filtros existente com
   <div class="filtros-wrap"><button class="btn-toggle-filtros" onclick="toggleFiltrosMobile(this)">🔍 Filtros</button><div class="filtros-conteudo">...filtros originais...</div></div>
   No desktop os filtros ficam sempre visíveis; só no celular é que ficam
   escondidos atrás do botão, para não poluir a tela. */
.btn-toggle-filtros {
    display: none;
}

.filtros-conteudo {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    .btn-toggle-filtros {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
        padding: 10px 14px;
        margin-bottom: 10px;
        background: white;
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        color: var(--dark);
        cursor: pointer;
    }

    .filtros-conteudo {
        display: none;
    }

    .filtros-conteudo.aberto {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .filtros-conteudo.aberto select,
    .filtros-conteudo.aberto input {
        width: 100%;
    }
}
/* FIX: movidas para o final do arquivo — antes estavam espalhadas e sendo sobrescritas por regras normais definidas depois delas no arquivo (CSS usa ordem de origem como desempate quando a especificidade é igual, e uma media query não tem prioridade automática sobre uma regra fora dela). */

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    .custom-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90vw !important;
        max-width: 400px !important;
        max-height: 80vh !important;
    }

    .dropdown-toggle {
        width: 100%;
    }

    #material-results-info {
        font-size: 13px;
        flex-direction: column;
        align-items: stretch;
    }

    .results-info-main {
        flex-direction: column;
        align-items: stretch;
    }

    .results-badge {
        justify-content: center;
    }

    /* Sidebar vira uma "gaveta" (off-canvas): fica totalmente escondida fora
       da tela e desliza por cima do conteúdo ao abrir, em vez de dividir
       espaço permanentemente com a área principal. */
    .sidebar {
        width: 260px;
        max-width: 82vw;
        padding: 16px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 2000;
    }

    .sidebar.aberta {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }

    .logo-img {
        width: 52px;
        height: 52px;
    }

    .btn-menu-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 12px 10px;
    }

    .cards-container,
    .colaboradores-lista {
        grid-template-columns: 1fr;
    }

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

    .org-card {
        min-width: 150px;
        max-width: 170px;
        padding: 15px;
    }

    .org-card-foto {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    /* Lista de colaboradores em coluna única */
    .colaboradores-lista {
        grid-template-columns: 1fr;
    }

    /* Modais ocupam mais espaço em mobile */
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    /* Em telas pequenas a grade de mês (7 colunas) fica ilegível, então ela
       é escondida e substituída por uma agenda em lista vertical (ver
       .calendario-agenda logo abaixo), que é rolada como o resto da página
       em vez de precisar de zoom/pinça. */
    .calendario-grid {
        display: none;
    }

    .calendario-agenda {
        display: flex;
    }

    .org-card-v2 {
        min-width: 160px;
        max-width: 180px;
        padding: 15px;
    }

    .org-card-foto-v2 {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }

    .calendario-controles {
        flex-direction: column;
        width: 100%;
    }

    .calendario-select {
        width: 100%;
    }

    .resumo-stats {
        grid-template-columns: 1fr;
    }

    .chart-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .chart-value {
        text-align: left;
    }

    .org-card-hierarquico {
        width: 100%;
        max-width: 280px;
    }

    .export-options-grid {
        grid-template-columns: 1fr;
    }

    /* ✅ NOVO (pedido do usuário): reforço — padding lateral menor e botões
       em coluna (cada um ocupando a linha toda) no rodapé de exportação. */
    .export-footer {
        padding: 14px 12px;
    }

    .export-footer .btn,
    .export-footer .btn-secondary,
    .export-footer .btn-primary {
        flex: 1 1 auto;
    }

    .export-header {
        padding: 14px 16px;
    }

    .export-body {
        padding: 16px;
    }

    .date-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .date-separator {
        margin: 0;
        text-align: center;
    }

    /* ===== GUIAS/ABAS: rolagem horizontal em vez de ficarem cortadas ===== */
    .tabs,
    .colab-tabs,
    .eqtabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 2px;
    }

    .tabs .tab,
    .colab-tab,
    .eqtab-btn,
    .eqview-btn,
    .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .tabs::-webkit-scrollbar,
    .colab-tabs::-webkit-scrollbar,
    .eqtabs::-webkit-scrollbar {
        height: 4px;
    }

    .tabs::-webkit-scrollbar-thumb,
    .colab-tabs::-webkit-scrollbar-thumb,
    .eqtabs::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

}

@media (max-width: 1024px) {
    .calendario-header {
        grid-template-columns: 1fr;
        text-align: center;

        flex-direction: column;
        align-items: stretch;
    }

    .calendario-mes {
        text-align: center;
    }

    .calendario-nav {
        justify-content: center;
    }

    .btn-export {
        grid-column: 1;
    }

    .calendario-controles,
    .calendario-nav {
        justify-content: center;
    }

}

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

    .org-nivel-turnos {
        grid-template-columns: 1fr;
    }

    .org-cards-container {
        flex-direction: column;
    }

    .org-linha-horizontal {
        width: 3px;
        height: 30px;
        background: linear-gradient(180deg, #dee2e6 0%, #adb5bd 100%);
    }
}

@media (max-width: 1400px) {

    /* Sidebar de eventos vira bloco abaixo do conteúdo */
    #eventos-ativos-sidebar {
        position: relative;
        width: 100%;
        max-height: 400px;
        margin-top: 20px;

        position: relative;
        width: 100%;
        max-height: 400px;
        margin-top: 30px;
        right: auto;
        top: auto;

    }

    /* Organograma ocupa largura total */
    .organograma-container {
        width: 100%;
    }

    #eventos-ativos-sidebar {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        max-height: 400px;
        margin-top: 20px;
        border-radius: 12px;
    }

    .colaboradores-lista,
    .organograma-container {
        margin-right: 0;
    }

    #eventos-ativos-sidebar {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        max-height: 400px;
        margin-top: 20px;
        border-radius: 12px;
        margin-right: 0;
    }

    #calendario-view {
        margin-right: 0;
    }
}

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    .period-selectors {
        flex-direction: column;
        align-items: stretch;
    }

    .period-separator {
        margin: 0;
        text-align: center;
    }

    /* ✅ CORRIGIDO (pedido do usuário): mês+ano lado a lado dividiam a
       largura ao meio — "Setembro" ficava cortado em "Setemb". Cada um
       fica na sua própria linha, com a largura toda pra si. */
    .period-inputs {
        flex-direction: column;
    }
}

@media (max-width: 1200px) {
    .instalacoes-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    .mapa-legenda {
        position: static;
        margin-top: 20px;
        max-width: 100%;
    }

    .instalacoes-grid,
    .manutencao-grid {
        grid-template-columns: 1fr;
    }

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

    .filtros-localidades {
        flex-direction: column;
    }

    .filtros-localidades select,
    .filtros-localidades input {
        width: 100%;
        min-width: auto;
    }

    .tabs {
        overflow-x: auto;
        padding: 0 15px;
    }

    .tabs .tab {
        white-space: nowrap;
        padding: 12px 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    #localidades-tab-content {
        padding: 15px;
    }

    .instalacao-actions,
    .estoque-item-actions {
        flex-direction: column;
    }

    .instalacao-actions .btn,
    .estoque-item-actions .btn {
        width: 100%;
    }
}

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    #feedback-fab {
        right: 14px;
        bottom: 80px;
        width: 46px;
        height: 46px;
        font-size: 19px;
    }
}

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {

    .loc-grid,
    .loc-grid.manutencao {
        grid-template-columns: 1fr;
    }

    .loc-filtros {
        flex-direction: column;
    }

    .loc-filtros select,
    .loc-filtros input {
        width: 100%;
        min-width: auto;
    }

    .mapa-legenda {
        display: none;
    }

    .loc-tabs-bar {
        gap: 2px;
        padding: 8px 12px;
    }

    .loc-tab {
        padding: 8px 12px;
        font-size: 13px;
    }

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

@media (max-width: 480px) {
    .loc-tab-content {
        padding: 12px;
    }

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

    .loc-card-actions {
        flex-direction: column;
    }
}

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    #manual-container>div>div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
    }

    #manual-container [style*="position:sticky"] {
        position: relative !important;
        top: auto !important;
    }
}

@media (max-width: 900px), (max-height: 500px) and (orientation: landscape) {
    #dashboard-container [style*="grid-template-columns:1fr 340px"] {
        display: flex !important;
        flex-direction: column !important;
    }

    #dashboard-container [style*="grid-template-columns:1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }
}

@media (max-width: 600px) {
    #dashboard-container [style*="grid-template-columns:repeat(auto-fill,minmax(200px"] {
        grid-template-columns: 1fr 1fr !important;
    }

    .header {
        flex-wrap: wrap;
    }

    /* FIX (pedido do usuário): a busca global estava escondida no celular —
       agora fica visível, ocupando a linha toda abaixo do título. */
    .header > div:has(#busca-global-input) {
        order: 3;
        flex-basis: 100%;
        max-width: 100% !important;
        margin: 8px 0 0 !important;
    }

    /* FIX (pedido do usuário): em telas pequenas, o título "encostava" no
       sino de notificações e forçava ele pra segunda linha do header — daí
       o painel de notificações (ancorado nesse botão) abria fora do lugar,
       ficando escondido atrás da sidebar/logo. Título agora encolhe e corta
       com reticências em vez de empurrar o sino para baixo. */
    .header h1 {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* O painel de notificações deixa de ser ancorado (position:absolute) ao
       botão do sino — nessa largura de tela ele vira uma folha fixa no topo
       da viewport, então continua visível e no lugar certo mesmo que o
       botão do sino mude de posição/linha. z-index acima da sidebar (gaveta
       usa 2000) para nunca ficar escondido atrás dela. */
    #notificacoes-painel {
        position: fixed !important;
        top: 64px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        z-index: 2100 !important;
    }

    /* ✅ NOVO (pedido do usuário): vários modais (Detalhes do Colaborador,
       Eventos/Férias do colaborador, Gerenciar Tipos de Eventos, Exportar
       Calendário, etc.) ficavam com botões e cabeçalhos espremidos/cortados
       em celular na vertical. Ajustes gerais, aplicados a QUALQUER modal —
       não é preciso corrigir tela por tela. */
    .modal-content {
        width: 94% !important;
        max-height: 92vh;
    }

    .modal-header {
        padding: 12px 14px;
        flex-wrap: wrap;
    }

    .modal-header h2 {
        font-size: 17px;
        word-break: break-word;
    }

    /* Rodapés com vários botões lado a lado (Cancelar/Salvar, Editar/Excluir
       etc.) empilham em vez de espremer ou vazar pra fora do modal. */
    .modal-footer {
        flex-wrap: wrap;
    }

    /* ✅ NOVO (pedido do usuário): "Detalhes do Colaborador" mostrava Férias
       Atuais e Eventos Recentes lado a lado (2 colunas) — numa tela
       estreita isso espremia tudo e cortava texto. Vira 1 coluna só,
       sequenciado (Férias primeiro, Eventos depois). */
    .detalhes-colab-grid {
        grid-template-columns: 1fr !important;
    }

    /* ✅ NOVO (pedido do usuário): cabeçalhos com título + botões de ação
       (ex.: "Histórico Completo" + "Voltar", "Todas as Férias" +
       "Novo Planejamento"/"Voltar", "Todos os Eventos" + "Novo"/"Voltar")
       — os botões agora ficam ABAIXO do texto em vez de espremidos do lado,
       que era onde cortava/sobrepunha em tela pequena. */
    .secao-header-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .secao-header-flex > div {
        width: 100%;
        flex-wrap: wrap;
    }

    /* ✅ NOVO (pedido do usuário): "Gerenciar Tipos de Eventos" tinha
       setinhas de ordem + ícone + nome + botões de ação todos numa linha só
       — não cabia em tela estreita e cortava o botão de excluir. Quebra em
       2 linhas: ordem+ícone+nome em cima, ações embaixo, alinhadas à direita. */
    .tipo-evento-item {
        flex-wrap: wrap;
    }

    .tipo-evento-info {
        flex-basis: 100%;
        order: 1;
    }

    .tipo-evento-acoes {
        margin-left: auto;
        order: 2;
    }
}

/* FIX (pedido do usuário): o ajuste acima só cobria retrato (max-width:600px)
   — em modo PAISAGEM num aparelho pequeno a largura passa de 600px (às vezes
   700–900px), então a regra não entrava, e o sino/painel de notificações
   voltavam a ficar quebrados/escondidos. Mesmas correções, disparadas por
   ALTURA pequena (típico de celular deitado) em vez de largura, e com o
   painel limitado em altura + rolagem, já que sobra pouco espaço vertical. */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        flex-wrap: wrap;
    }

    .header h1 {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #notificacoes-painel {
        position: fixed !important;
        top: 8px !important;
        right: 10px !important;
        left: auto !important;
        width: 320px !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 16px) !important;
        overflow-y: auto !important;
        z-index: 2100 !important;
    }

    /* ✅ NOVO (pedido do usuário): modais em geral (Detalhes do Colaborador,
       Eventos/Férias, Gerenciar Tipos de Eventos, Exportar Calendário, etc.)
       ficavam desorganizados nessa altura mínima — o cabeçalho colorido e o
       espaçamento interno sozinhos já ocupavam boa parte da tela. Reduz
       margens/paddings do essencial e garante que o miolo role por conta
       própria, sem cortar botões de ação (que costumam ficar no fim). */
    .modal-content {
        max-height: calc(100vh - 16px) !important;
        width: 96% !important;
        margin: 8px auto !important;
    }

    .modal-header {
        padding: 10px 16px !important;
    }

    .modal-header h2 {
        font-size: 16px !important;
    }

    .modal-body,
    .modal-content > div:not(.modal-header) {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    /* ✅ NOVO (pedido do usuário): mesmo ajuste do retrato — colunas de
       Férias/Eventos empilhadas e cabeçalhos com botão abaixo do texto —
       vale igual (ou mais) em paisagem, onde a altura é ainda mais curta. */
    .detalhes-colab-grid {
        grid-template-columns: 1fr !important;
    }

    .secao-header-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    .secao-header-flex > div {
        width: 100%;
        flex-wrap: wrap;
    }
}


/* =====================================================================
   PROGRAMAÇÃO DE FÉRIAS EM LOTE (Colaboradores > Programação em Lote)
   Mobile-first: base = celular em retrato. Breakpoints:
   ≥600px  tablet retrato / celular paisagem
   ≥1024px tablet paisagem / desktop   |  ≥1500px telas grandes
   ===================================================================== */
.plote {
    --pl-plan-bg: #fff6dd; --pl-plan-bd: #f0b429; --pl-plan-tx: #7a5200;
    --pl-apr-bg: #e4f5ea;  --pl-apr-bd: #28a745;  --pl-apr-tx: #14532d;
    --pl-rec-bg: #fde8ea;  --pl-rec-bd: #dc3545;  --pl-rec-tx: #7f1d1d;
    --pl-card-bg: #fff; --pl-muted: #64748b; --pl-line: #e2e8f0;
    width: 100%;
    min-width: 0;
}
body.tema-escuro .plote {
    --pl-plan-bg: #3d3210; --pl-plan-bd: #b8860b; --pl-plan-tx: #fde68a;
    --pl-apr-bg: #12341f;  --pl-apr-bd: #2e8b4a;  --pl-apr-tx: #bbf7d0;
    --pl-rec-bg: #3f1519;  --pl-rec-bd: #b3303c;  --pl-rec-tx: #fecaca;
    --pl-card-bg: #1e2430; --pl-muted: #94a3b8; --pl-line: #334155;
}

/* --- barra de controles --- */
.plote-toolbar {
    display: flex; flex-direction: column; gap: 12px;
    background: var(--pl-card-bg); border: 1px solid var(--pl-line);
    border-radius: 10px; padding: 12px; margin-bottom: 12px;
}
.plote-label { display: block; font-size: 12px; font-weight: 600; color: var(--pl-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.plote-janela-sel { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plote-janela-sel select, .plote-filtros select, .plote-filtros input {
    padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; min-width: 0;
}
.plote-janela-sel select { flex: 1 1 110px; }
.plote-nav, .plote-hoje {
    padding: 8px 12px; border: 1px solid var(--border); background: #fff; color: var(--dark);
    border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1;
}
.plote-nav { min-width: 40px; font-size: 20px; }
.plote-nav:hover, .plote-hoje:hover { border-color: var(--primary); color: var(--primary); }
body.tema-escuro .plote-nav, body.tema-escuro .plote-hoje { background: #2a3140; color: #e5e7eb; }
.plote-janela-txt { font-size: 13px; color: var(--pl-muted); margin-top: 6px; }
.plote-filtros { display: flex; flex-direction: column; gap: 8px; }
.plote-filtros input { width: 100%; }

/* --- legenda / filtro de status --- */
.plote-legenda { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.plote-leg {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
    border: 2px solid var(--pl-line); background: var(--pl-card-bg); color: inherit;
    font-size: 13px; font-weight: 600; cursor: pointer; flex: 1 1 calc(50% - 8px); justify-content: center;
}
.plote-leg.plote-planejada { background: var(--pl-plan-bg); border-color: var(--pl-plan-bd); color: var(--pl-plan-tx); }
.plote-leg.plote-aprovada  { background: var(--pl-apr-bg);  border-color: var(--pl-apr-bd);  color: var(--pl-apr-tx); }
.plote-leg.plote-rejeitada { background: var(--pl-rec-bg);  border-color: var(--pl-rec-bd);  color: var(--pl-rec-tx); }
.plote-leg.ativo { box-shadow: 0 0 0 3px rgba(0, 120, 212, .35); }
.plote-leg-todos.ativo { border-color: var(--primary); }
.plote-leg-n { background: rgba(0, 0, 0, .12); border-radius: 999px; padding: 0 8px; font-size: 12px; }

.plote-resumo { font-size: 12.5px; color: var(--pl-muted); margin: 0 2px 10px; }

/* --- cards por colaborador --- */
.plote-lista { display: flex; flex-direction: column; gap: 12px; }
.plote-card {
    background: var(--pl-card-bg); border: 1px solid var(--pl-line); border-radius: 10px;
    overflow: hidden; min-width: 0;
}
.plote-card.plote-inativo { border-style: dashed; opacity: .92; }
.plote-card-head { padding: 10px 12px; background: rgba(0, 120, 212, .06); border-bottom: 1px solid var(--pl-line); }
.plote-nome { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; overflow-wrap: anywhere; }
.plote-badge-inativo { font-size: 11px; font-weight: 600; background: #e2e8f0; color: #475569; border-radius: 999px; padding: 1px 8px; }
body.tema-escuro .plote-badge-inativo { background: #334155; color: #cbd5e1; }
.plote-sub { font-size: 12px; color: var(--pl-muted); margin-top: 2px; }
.plote-aviso { font-size: 11.5px; color: #b45309; margin-top: 4px; }

.plote-ciclos { display: flex; flex-direction: column; }
.plote-ciclo { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.plote-ciclo + .plote-ciclo { border-top: 1px dashed var(--pl-line); }
.plote-ciclo-info { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.plote-ciclo-rot { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--pl-muted); font-weight: 600; }
.plote-ciclo-datas { font-size: 13.5px; }
.plote-saldo { color: var(--pl-muted); }
.plote-saldo-ok { color: #15803d; font-weight: 600; }
.plote-saldo-estouro { color: #dc2626; font-weight: 700; }
.plote-abono { color: var(--pl-muted); font-size: 12.5px; }
.plote-abono.tem { color: #7c3aed; font-weight: 700; }

/* --- chips de período --- */
.plote-periodos { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; min-width: 0; }
.plote-chip {
    display: flex; align-items: stretch; flex: 1 1 100%; min-width: 0;
    border: 2px solid; border-radius: 8px; overflow: hidden;
}
.plote-chip.plote-planejada { background: var(--pl-plan-bg); border-color: var(--pl-plan-bd); color: var(--pl-plan-tx); }
.plote-chip.plote-aprovada  { background: var(--pl-apr-bg);  border-color: var(--pl-apr-bd);  color: var(--pl-apr-tx); }
.plote-chip.plote-rejeitada { background: var(--pl-rec-bg);  border-color: var(--pl-rec-bd);  color: var(--pl-rec-tx); }
.plote-chip-main {
    flex: 1; min-width: 0; text-align: left; background: transparent; border: 0; color: inherit;
    padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit;
}
.plote-chip-main:hover { background: rgba(0, 0, 0, .05); }
.plote-chip-linha { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; flex-wrap: wrap; }
.plote-chip-dias { font-weight: 600; opacity: .85; }
.plote-chip-st { font-size: 11.5px; font-weight: 600; opacity: .85; }
.plote-chip-motivo { font-size: 11.5px; font-style: italic; overflow-wrap: anywhere; }
.plote-chip-edit {
    border: 0; border-left: 1px solid currentColor; background: rgba(255, 255, 255, .35); color: inherit;
    padding: 0 12px; cursor: pointer; font-size: 16px;
}
.plote-chip-edit:hover { background: rgba(255, 255, 255, .7); }
.plote-vazio { font-size: 13px; color: var(--pl-muted); align-self: center; flex: 1 1 100%; }
.plote-add {
    border: 2px dashed var(--primary); color: var(--primary); background: transparent; border-radius: 8px;
    padding: 8px 12px; font-weight: 600; font-size: 13px; cursor: pointer; flex: 1 1 100%;
}
.plote-add:hover { background: rgba(0, 120, 212, .08); }

/* --- ≥600px: tablet em retrato e celular em paisagem --- */
@media (min-width: 600px) {
    .plote-toolbar { flex-direction: row; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
    .plote-janela-sel select { flex: 0 0 auto; }
    .plote-filtros { flex-direction: row; flex: 1 1 280px; max-width: 520px; }
    .plote-filtros input { flex: 1 1 auto; }
    .plote-leg { flex: 0 0 auto; }
    .plote-ciclo { flex-direction: row; gap: 14px; align-items: flex-start; }
    .plote-ciclo-info { flex: 0 0 210px; }
    .plote-periodos { flex: 1; }
    .plote-chip { flex: 1 1 230px; max-width: 340px; }
    .plote-add { flex: 0 0 auto; }
    .plote-vazio { flex: 1 1 auto; }
}

/* --- ≥1024px: tablet em paisagem / desktop — nome à esquerda, ciclos à direita --- */
@media (min-width: 1024px) {
    .plote-card { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
    .plote-card-head { border-bottom: 0; border-right: 1px solid var(--pl-line); }
    .plote-ciclo-info { flex-basis: 250px; }
    .plote-nome { font-size: 15.5px; }
}

/* --- ≥1500px: telas grandes --- */
@media (min-width: 1500px) {
    .plote-card { grid-template-columns: 280px minmax(0, 1fr); }
    .plote-ciclo-info { flex-basis: 290px; }
    .plote-chip { flex: 0 1 280px; }
}

/* --- celular em paisagem (pouca altura): compacta tudo --- */
@media (orientation: landscape) and (max-height: 520px) {
    .plote-toolbar { padding: 8px 10px; gap: 8px; margin-bottom: 8px; }
    .plote-legenda { margin-bottom: 8px; }
    .plote-leg { padding: 5px 10px; font-size: 12px; }
    .plote-card-head { padding: 6px 10px; }
    .plote-ciclo { padding: 8px 10px; gap: 8px; }
    .plote-chip-main { padding: 5px 8px; }
    .plote-lista { gap: 8px; }
    .plote-janela-txt { margin-top: 3px; }
}

/* ---------- Programação em Lote: separação nítida entre colaboradores ---------- */
.plote-lista { gap: 20px; }
.plote-card {
    border: 1px solid #94a3b8; border-left: 6px solid var(--primary);
    box-shadow: 0 3px 8px rgba(15, 23, 42, .14);
}
body.tema-escuro .plote-card { border-color: #475569; border-left-color: var(--primary); box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.plote-card.plote-inativo { border-left-color: #94a3b8; border-left-style: solid; }
.plote-card-head { background: rgba(0, 120, 212, .14); border-bottom: 2px solid var(--primary); padding: 12px 14px; }
.plote-card.plote-inativo .plote-card-head { background: rgba(100, 116, 139, .16); border-bottom-color: #94a3b8; }
.plote-nome { font-size: 16px; }
.plote-ciclo + .plote-ciclo { border-top: 2px dashed var(--pl-line); }
@media (min-width: 1024px) {
    .plote-lista { gap: 14px; }
    .plote-card-head { border-bottom: 0; border-right: 2px solid var(--primary); }
    .plote-card.plote-inativo .plote-card-head { border-right-color: #94a3b8; }
}
@media (orientation: landscape) and (max-height: 520px) {
    .plote-lista { gap: 14px; }
}

/* ---------- Aprovações: filtros (ocultos em celular, retrato e paisagem) ---------- */
.aprov-filtros { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.aprov-filtros input[type="search"] {
    flex: 1 1 240px; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.aprov-filtros select {
    flex: 0 1 340px; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
@media (max-width: 767px), (orientation: landscape) and (max-height: 520px) {
    .aprov-filtros { display: none; }
}

/* ---------- Filtros mais compactos em telas grandes + botão "Limpar filtros" ---------- */
@media (min-width: 600px) {
    .plote-toolbar { justify-content: flex-start; gap: 14px 32px; }
    .plote-filtros { flex: 0 1 auto; max-width: none; flex-wrap: wrap; align-items: center; }
    .plote-filtros input { flex: 0 1 280px; width: 280px; }
    .plote-filtros select { flex: 0 1 220px; }
}
.aprov-filtros { align-items: center; }
.aprov-filtros input[type="search"] { flex: 0 1 300px; }
.aprov-filtros select { flex: 0 1 330px; }
.plote-limpar, .aprov-limpar {
    padding: 8px 14px; border: 1px solid var(--border); background: transparent; color: var(--pl-muted, #64748b);
    border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.plote-limpar:hover, .aprov-limpar:hover { border-color: #dc2626; color: #dc2626; }
@media (max-width: 599px) { .plote-limpar { width: 100%; } }

/* ---------- Abono: selo de situação e fila de abonos pendentes ---------- */
.abono-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.abono-tag.pendente { background: #fff6dd; color: #7a5200; border: 1px solid #f0b429; }
.abono-tag.aprovado { background: #e4f5ea; color: #14532d; border: 1px solid #28a745; }
body.tema-escuro .abono-tag.pendente { background: #3d3210; color: #fde68a; border-color: #b8860b; }
body.tema-escuro .abono-tag.aprovado { background: #12341f; color: #bbf7d0; border-color: #2e8b4a; }
.plote-abono.recusado { color: #dc2626; font-weight: 600; }
.plote-abono { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.plote-ab-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid; background: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.plote-ab-btn.ok { color: #15803d; border-color: #28a745; }
.plote-ab-btn.no { color: #dc2626; border-color: #dc3545; }
.plote-ab-btn:hover { filter: brightness(.93); }
.abono-pendentes { border: 2px solid #f0b429; background: rgba(240, 180, 41, .10); border-radius: 10px; padding: 10px 12px; margin-bottom: 18px; }
.abono-pend-titulo { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.abono-pend-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 8px 0; border-top: 1px dashed rgba(0, 0, 0, .15); }
.abono-pend-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.abono-pend-info span { color: #64748b; font-size: 12.5px; }
.abono-pend-acoes { display: flex; gap: 8px; flex-wrap: wrap; }


/* v3.33: card de equipamento selecionável com um clique */
.card[data-eq-id] { cursor: pointer; transition: box-shadow .15s, background .15s; }
.card.eq-card-sel { outline: 2px solid #0078d4; background: #eef6ff; }


/* =====================================================================
   v3.41 — Programação em Lote: subguias (Lista | Calendário) e calendário
   de férias (somente férias + feriados, com aprovação direto do dia)
   ===================================================================== */
.plote-subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 2px solid var(--pl-line); }
.plote-subtab {
    padding: 9px 16px; border: none; background: transparent; cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--pl-muted);
    border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.plote-subtab:hover { color: var(--primary); }
.plote-subtab.ativo { color: var(--primary); border-bottom-color: var(--primary); }

.plcal-titulo { text-align: center; font-size: 18px; font-weight: 700; margin: 6px 0 10px; }
.plcal-leg-fer { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.plcal-grid {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px;
    background: var(--pl-line); border: 1px solid var(--pl-line); border-radius: 8px; overflow: hidden;
}
.plcal-sem { background: #f1f5f9; padding: 6px 2px; text-align: center; font-size: 12px; font-weight: 700; color: var(--pl-muted); }
.plcal-dia {
    background: var(--pl-card-bg); min-height: 96px; padding: 4px; min-width: 0;
    display: flex; flex-direction: column; gap: 2px; cursor: pointer; overflow: hidden;
}
.plcal-dia.plcal-vazio { cursor: default; background: rgba(148, 163, 184, .10); }
.plcal-dia:not(.plcal-vazio):hover, .plcal-dia:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.plcal-dia.hoje .plcal-num { background: var(--primary); color: #fff; border-radius: 999px; min-width: 22px; padding: 0 5px; text-align: center; align-self: flex-start; }
.plcal-dia.feriado { background: #fffbeb; }
.plcal-num { font-size: 13px; font-weight: 700; line-height: 22px; }
.plcal-fer { font-size: 10.5px; font-weight: 600; background: #fef3c7; color: #92400e; border-left: 3px solid #f59e0b; border-radius: 3px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plcal-fer span { overflow: hidden; text-overflow: ellipsis; }
.plcal-chip { flex: 0 0 auto; font-size: 11px; line-height: 1.3; padding: 1px 5px; border-radius: 3px; border-left: 3px solid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plcal-st-planejada { background: var(--pl-plan-bg); border-color: var(--pl-plan-bd); color: var(--pl-plan-tx); }
.plcal-st-aprovada  { background: var(--pl-apr-bg);  border-color: var(--pl-apr-bd);  color: var(--pl-apr-tx); }
.plcal-st-rejeitada { background: var(--pl-rec-bg);  border-color: var(--pl-rec-bd);  color: var(--pl-rec-tx); text-decoration: line-through; }
.plcal-mais { font-size: 10.5px; font-weight: 700; color: var(--primary); }
body.tema-escuro .plcal-sem { background: #273041; }
body.tema-escuro .plcal-dia.feriado { background: #2f2a14; }
body.tema-escuro .plcal-fer, body.tema-escuro .plcal-leg-fer { background: #3d3210; color: #fde68a; }

/* celular: o dia mostra só barrinhas coloridas; o detalhe abre ao tocar */
@media (max-width: 599px) {
    .plcal-dia { min-height: 62px; padding: 2px; }
    .plcal-num { font-size: 12px; line-height: 18px; }
    .plcal-chip { height: 6px; padding: 0; font-size: 0; }
    .plcal-chip-txt { display: none; }
    .plcal-fer { font-size: 0; height: 6px; padding: 0; }
    .plcal-mais { font-size: 9px; }
}

/* lista do dia (modal) */
.plcal-dia-cab { font-size: 13px; color: var(--pl-muted); margin-bottom: 8px; }
.plcal-dia-fer { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
body.tema-escuro .plcal-dia-fer { background: #3d3210; color: #fde68a; }
.plcal-item { border: 1px solid var(--pl-line); border-left-width: 5px; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--pl-card-bg); }
.plcal-item-planejada { border-left-color: var(--pl-plan-bd); }
.plcal-item-aprovada { border-left-color: var(--pl-apr-bd); }
.plcal-item-rejeitada { border-left-color: var(--pl-rec-bd); }
.plcal-item-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.plcal-item-st { font-size: 12px; font-weight: 700; }
.plcal-item-planejada .plcal-item-st { color: var(--pl-plan-tx); }
.plcal-item-aprovada .plcal-item-st { color: var(--pl-apr-tx); }
.plcal-item-rejeitada .plcal-item-st { color: var(--pl-rec-tx); }
.plcal-item-det { font-size: 13px; color: var(--pl-muted); margin-top: 2px; }
.plcal-item-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.plcal-item-acoes .btn { padding: 6px 12px; font-size: 13px; }


/* v3.50: detalhes do equipamento legíveis em tela pequena */
.eqd-wrap { padding: 20px; }
.eqd-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid #e9ecef; }
.eqd-head h3 { font-size: 20px; }
.eqd-status { color: #fff; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.eqd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.eqd-card { background: #f8f9fa; border-radius: 8px; padding: 14px; min-width: 0; }
.eqd-titulo { font-size: 11px; font-weight: 700; color: #555; text-transform: uppercase; margin-bottom: 8px; }
.eqd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; border-bottom: 1px dashed #e2e8f0; font-size: 13px; line-height: 1.35; }
.eqd-row:last-child { border-bottom: none; }
.eqd-row b { color: #475569; font-weight: 600; flex: 0 1 45%; }
.eqd-row span { text-align: right; overflow-wrap: anywhere; flex: 1; }
.eqd-acoes { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid #e9ecef; }
@media (max-width: 600px) {
    .eqd-wrap { padding: 12px; }
    .eqd-head h3 { font-size: 17px; }
    .eqd-acoes .btn { flex: 1 1 100%; }
}

.eqd-par { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -6px 0 16px; }
.eqd-par-atual { background: #e7f1ff; color: #0b5ed7; border-radius: 16px; padding: 5px 12px; font-size: 12px; font-weight: 700; }
.eqd-par-btn { background: #fff; border: 1px solid #ced4da; color: #495057; border-radius: 16px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.eqd-par-btn:hover { background: #f1f3f5; }

.eqd-titulo-flex { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eqd-titulo-flex .eqd-par-btn { text-transform: none; font-weight: 600; }
.status-badge.transferido, .badge-resumo.transferido { background: #ede9fe; color: #6d28d9; }
.badge-resumo.activetransferido { box-shadow: 0 0 0 2px #7c3aed; }
.badge-resumo.transferido .progress-fill { background: #7c3aed; }

/* v3.56.4: textos longos de evento (tipo/descrição) quebram linha em vez de estourar o card */
.evento-item, .evento-tipo, .evento-colaborador { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }

/* ============================================================
   MÓDULO CARGA TÉRMICA (v3.57) — prefixo .ct-
   ============================================================ */
.ct-abas { display: flex; gap: 6px; overflow-x: auto; border-bottom: 2px solid var(--border); margin-bottom: 14px; }
.ct-aba { background: none; border: none; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.ct-aba.ativa { color: var(--primary); border-bottom-color: var(--primary); }
.ct-card, .ct-sec { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.ct-sec h3 { font-size: 15px; margin-bottom: 8px; color: var(--primary); }
.ct-h4 { margin: 14px 0 8px; font-size: 14px; }
.ct-dica { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.ct-mut { color: var(--text-muted); font-size: 12px; }
.ct-lbl { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.ct-in { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; background: var(--card-bg); color: var(--text); font-family: inherit; }
.ct-num { text-align: right; min-width: 80px; }
.ct-ident, .ct-geo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ct-tabela { overflow-x: auto; }
.ct-tabela table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ct-tabela th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--text-muted); padding: 6px; border-bottom: 2px solid var(--border); }
.ct-tabela td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ct-r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-fator { font-weight: 600; }
.ct-totais-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.ct-tot { background: rgba(0,120,212,.08); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ct-tot span, .ct-tot small, .ct-final small, .ct-equip small, .ct-item-res small { font-size: 12px; color: var(--text-muted); }
.ct-tot b { font-size: 17px; }
.ct-final { display: grid; grid-template-columns: 1.2fr repeat(4, 1fr); gap: 8px; align-items: center; background: var(--primary); color: #fff; border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.ct-final div { display: flex; flex-direction: column; }
.ct-final b { font-size: 20px; }
.ct-final small, .ct-final span { color: rgba(255,255,255,.85); font-weight: 600; }
.ct-equip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ct-equip div { background: rgba(0,120,212,.08); border-radius: 8px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.ct-equip b { font-size: 18px; }
.ct-notas { margin: 10px 0 0 18px; font-size: 12px; color: var(--text-muted); }
.ct-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.ct-item { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.ct-item-info { flex: 1 1 220px; min-width: 0; }
.ct-item-res { display: flex; flex-direction: column; text-align: right; }
.ct-item-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.ct-conv-in { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
@media (max-width: 768px) {
    .ct-ident, .ct-geo, .ct-totais-grid, .ct-conv-in { grid-template-columns: 1fr; }
    .ct-final { grid-template-columns: 1fr 1fr; }
    .ct-final > div:first-child { grid-column: 1 / -1; }
    /* tabelas viram cartões no celular */
    .ct-tabela table, .ct-tabela tbody, .ct-tabela tr, .ct-tabela td { display: block; width: 100%; }
    .ct-tabela thead { display: none; }
    .ct-tabela tr { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; }
    .ct-tabela td { border: none; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: right; }
    .ct-tabela td::before { content: attr(data-l); font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); text-align: left; flex: 0 0 38%; }
    .ct-tabela td .ct-in { max-width: 62%; }
}
/* v3.57.1 — Carga Térmica: expressões, hints e modelos de equipamento */
.ct-qtd { display: flex; flex-direction: column; align-items: stretch; min-width: 110px; }
.ct-hint { font-size: 11px; color: var(--primary); text-align: right; min-height: 0; font-weight: 600; }
.ct-hint:empty { display: none; }
.ct-hint.ct-erro { color: #d13438; }
.ct-auto { font-size: 15px; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ct-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none; }
.ct-chip.on { background: rgba(0,120,212,.12); border-color: var(--primary); font-weight: 600; }
.ct-chip input { accent-color: var(--primary); }
.ct-chip button { background: none; border: none; cursor: pointer; color: #d13438; font-size: 13px; padding: 0; }
.ct-add-equip { display: flex; gap: 8px; max-width: 420px; }
.ct-equip small.ct-mut { font-size: 11px; }
@media (max-width: 768px) { .ct-qtd { align-items: flex-end; flex: 0 0 62%; } .ct-qtd .ct-in { max-width: 100%; } }

/* ============================================================
   INÍCIO (v3.58.0) — cards de módulos + links úteis em grupos
   Responsivo: celular em retrato e em paisagem (pouca altura) usam o mesmo critério do restante do app.
   ============================================================ */
.ini-wrap { display: flex; flex-direction: column; gap: 22px; max-width: 1200px; margin: 0 auto; }
.ini-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: var(--card-radius, 10px);
    background: linear-gradient(135deg, var(--primary, #0078d4), var(--primary-dark, #005a9e)); color: #fff; box-shadow: var(--shadow); }
.ini-hello { margin: 0; font-size: 22px; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.ini-data { margin: 4px 0 0; font-size: 13px; opacity: .9; }
.ini-sec { min-width: 0; }
.ini-sec-titulo { margin: 0 0 10px; font-size: 16px; color: var(--text, #1e293b); }

/* — cards de módulos — */
.ini-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ini-card { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 64px; padding: 12px 14px; text-align: left; cursor: pointer;
    font: inherit; color: var(--text, #1e293b); background: var(--card-bg, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: var(--card-radius, 10px);
    box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.ini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover, 0 4px 16px rgba(0,0,0,.12)); border-color: var(--primary, #0078d4); }
.ini-card:active { transform: scale(.98); }
.ini-card:focus-visible, .ini-link-a:focus-visible, .ini-grupo > summary:focus-visible { outline: 3px solid var(--primary, #0078d4); outline-offset: 2px; }
.ini-card-ico { flex: 0 0 44px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 24px; border-radius: 10px;
    background: var(--primary-light, #cce4f6); }
.ini-card-txt { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.ini-card-tit { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.ini-card-desc { font-size: 12px; color: var(--text-muted, #6c757d); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* — links úteis — */
.ini-links-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.ini-links-head .ini-sec-titulo { margin: 0; }
.ini-links-ferr { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 1 1 280px; justify-content: flex-end; min-width: 0; }
.ini-busca { flex: 1 1 180px; min-width: 0; max-width: 340px; padding: 9px 12px; border: 1.5px solid var(--border, #dee2e6); border-radius: 8px; font-size: 14px; background: var(--card-bg, #fff); color: var(--text, #1e293b); }
.ini-btn-ger { white-space: nowrap; min-height: 40px; }
.ini-barra-topo { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.ini-dica { font-size: 12px; color: var(--text-muted, #6c757d); margin: 0; line-height: 1.4; }
.ini-vazio { text-align: center; padding: 22px 12px; color: var(--text-muted, #6c757d); background: var(--card-bg, #fff); border: 1px dashed var(--border, #dee2e6); border-radius: 10px; margin: 0; }
.ini-vazio-peq { padding: 10px; font-size: 13px; margin: 6px 0; }
.ini-aviso { padding: 12px 14px; border-radius: 8px; background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; margin: 0; font-size: 14px; }

.ini-grupo { background: var(--card-bg, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: var(--card-radius, 10px); margin-bottom: 10px; box-shadow: var(--shadow); min-width: 0; }
.ini-grupo .ini-grupo { box-shadow: none; margin: 10px 0 0; background: transparent; }
.ini-n1 { border-left: 4px solid var(--primary, #0078d4); }
.ini-n2, .ini-n3 { border-left: 4px solid var(--border, #cbd5e1); }
.ini-grupo > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; cursor: pointer; list-style: none; font-weight: 700; -webkit-tap-highlight-color: transparent; }
.ini-grupo > summary::-webkit-details-marker { display: none; }
.ini-grupo > summary::after { content: '▾'; margin-left: 4px; color: var(--text-muted, #6c757d); transition: transform .15s; flex: 0 0 auto; }
.ini-grupo:not([open]) > summary::after { transform: rotate(-90deg); }
.ini-g-ico { font-size: 20px; flex: 0 0 auto; }
.ini-g-nome { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ini-g-cont { flex: 0 0 auto; min-width: 24px; text-align: center; padding: 1px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--primary-light, #cce4f6); color: var(--primary-dark, #005a9e); }
.ini-badge { flex: 0 0 auto; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
.ini-badge-t { background: #e4f5ea; color: #14532d; }
.ini-badge-r { background: #fff6dd; color: #7a5200; }
.ini-g-corpo { padding: 0 14px 14px; }
.ini-g-desc { margin: 0 0 10px; font-size: 13px; color: var(--text-muted, #6c757d); }
.ini-barra { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 8px; border-radius: 8px; background: var(--bg, #f1f5f9); }
.ini-b { padding: 7px 10px; font-size: 13px; min-height: 38px; }
.ini-b-ico { min-width: 40px; padding: 7px 8px; }
.ini-b-perigo:hover:not(:disabled) { background: #fde8ea; border-color: #dc3545; }
.ini-b:disabled, .ini-i:disabled { opacity: .35; cursor: default; }

.ini-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ini-link { display: flex; align-items: stretch; gap: 4px; min-width: 0; border: 1px solid var(--border, #e2e8f0); border-radius: 9px; background: var(--card-bg, #fff); overflow: hidden; }
.ini-link:hover { border-color: var(--primary, #0078d4); }
.ini-link-a { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 52px; padding: 9px 12px; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ini-link-invalido { opacity: .6; cursor: not-allowed; }
.ini-link-ico { flex: 0 0 auto; font-size: 20px; }
.ini-link-txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ini-link-tit { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.ini-link-desc { font-size: 12px; color: var(--text-muted, #6c757d); overflow-wrap: anywhere; }
.ini-link-host { font-size: 11px; color: var(--primary, #0078d4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ini-link-ext { flex: 0 0 auto; margin-left: auto; color: var(--text-muted, #6c757d); font-size: 14px; }
.ini-link-acoes { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; padding-right: 6px; }
.ini-i { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 15px; }
.ini-i:hover:not(:disabled) { background: var(--bg, #f1f5f9); }
.ini-i-perigo:hover:not(:disabled) { background: #fde8ea; }

/* — formulários (janelas) — */
.ini-modal { z-index: 3000; }
.ini-modal-c { display: flex; flex-direction: column; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: hidden; }
.ini-modal-c .modal-header { padding: 14px 18px; flex: 0 0 auto; }
.ini-modal-c .modal-header h2 { font-size: 19px; }
.ini-modal-corpo { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 18px; }
.ini-modal-rodape { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border, #dee2e6); background: var(--card-bg, #fff); }
.ini-form { display: flex; flex-direction: column; gap: 12px; }
.ini-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; min-width: 0; }
.ini-lbl input, .ini-lbl select { width: 100%; min-width: 0; padding: 9px 10px; font-size: 16px; /* 16px evita o zoom automático do iOS */ border: 1.5px solid var(--border, #dee2e6); border-radius: 8px; font-weight: 400; background: var(--card-bg, #fff); color: var(--text, #1e293b); }
.ini-linha { display: flex; gap: 10px; align-items: flex-end; }
.ini-lbl-ico { flex: 0 0 76px; }
.ini-lbl-ico input { text-align: center; }
.ini-emojis { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -4px; }
.ini-emoji { width: 38px; height: 38px; font-size: 18px; border: 1px solid var(--border, #dee2e6); border-radius: 8px; background: var(--card-bg, #fff); cursor: pointer; }
.ini-fs { border: 1px solid var(--border, #dee2e6); border-radius: 8px; padding: 10px 12px; margin: 0; min-width: 0; }
.ini-fs legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.ini-radio { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; cursor: pointer; }
.ini-usr-ferr { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; align-items: center; }
.ini-usr-ferr input { flex: 1 1 160px; min-width: 0; padding: 8px 10px; font-size: 16px; border: 1.5px solid var(--border, #dee2e6); border-radius: 8px; background: var(--card-bg, #fff); color: var(--text, #1e293b); }
.ini-usr-niveis { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.ini-usr-lista { max-height: 240px; overflow-y: auto; border: 1px solid var(--border, #dee2e6); border-radius: 8px; }
.ini-usr { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; align-items: center; min-height: 44px; padding: 6px 10px; border-bottom: 1px solid var(--border, #eef1f4); cursor: pointer; }
.ini-usr:last-child { border-bottom: 0; }
.ini-usr input { width: 20px; height: 20px; }
.ini-usr-nome { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ini-usr-sub { grid-column: 2; font-size: 11.5px; color: var(--text-muted, #6c757d); overflow-wrap: anywhere; }

/* — celular (retrato) e celular deitado (paisagem, pouca altura) — */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    .ini-wrap { gap: 16px; }
    .ini-hero { padding: 14px 16px; }
    .ini-hello { font-size: 19px; }
    .ini-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .ini-card { padding: 10px 12px; min-height: 60px; gap: 10px; }
    .ini-card-ico { flex-basis: 38px; width: 38px; height: 38px; font-size: 20px; }
    .ini-card-tit { font-size: 14px; }
    .ini-links { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .ini-links-ferr { justify-content: stretch; flex-basis: 100%; }
    .ini-busca { max-width: none; flex: 1 1 100%; }
    .ini-btn-ger { flex: 1 1 100%; }
    .ini-g-corpo { padding: 0 10px 12px; }
    .ini-link-acoes { padding-right: 2px; }
}
/* retrato estreito: 2 colunas de cards; links em coluna única */
@media (max-width: 480px) {
    .ini-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .ini-card { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; min-height: 92px; }
    .ini-card-desc { font-size: 11px; -webkit-line-clamp: 2; }
    .ini-links { grid-template-columns: minmax(0, 1fr); }
    .ini-link { flex-wrap: wrap; }
    .ini-link-acoes { flex: 1 0 100%; justify-content: flex-end; padding: 0 6px 6px; }
    .ini-i { width: 44px; height: 40px; }
    .ini-barra .ini-b { flex: 1 1 calc(50% - 6px); }
    .ini-barra .ini-b-ico { flex: 1 1 calc(33% - 6px); }
    .ini-modal-c { width: 100%; max-width: 100%; border-radius: 12px 12px 0 0; align-self: flex-end; }
    .ini-modal.active { align-items: flex-end; }
}
/* paisagem com pouca altura: aproveita a largura, compacta a altura e mantém o rodapé das janelas à vista */
@media (max-height: 500px) and (orientation: landscape) {
    .ini-hero { padding: 8px 14px; }
    .ini-hello { font-size: 17px; }
    .ini-data { margin-top: 2px; font-size: 12px; }
    .ini-cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
    .ini-card { min-height: 52px; padding: 8px 10px; }
    .ini-card-desc { -webkit-line-clamp: 1; }
    .ini-links { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .ini-modal-c { max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); max-width: min(720px, 94vw); }
    .ini-modal-c .modal-header { padding: 8px 14px; }
    .ini-modal-c .modal-header h2 { font-size: 16px; }
    .ini-modal-corpo { padding: 10px 14px; }
    .ini-modal-rodape { padding: 6px 14px calc(6px + env(safe-area-inset-bottom, 0px)); }
    .ini-usr-lista { max-height: 34vh; }
    .ini-form { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .ini-card, .ini-grupo > summary::after { transition: none; } }

/* tema escuro */
body.tema-escuro .ini-aviso { background: #3d2a10; border-color: #b8860b; color: #fde68a; }
body.tema-escuro .ini-badge-t { background: #12341f; color: #bbf7d0; }
body.tema-escuro .ini-badge-r { background: #3d3210; color: #fde68a; }
body.tema-escuro .ini-g-cont { background: #1e3a5f; color: #bfdbfe; }
body.tema-escuro .ini-card-ico { background: #1e3a5f; }
body.tema-escuro .ini-b-perigo:hover:not(:disabled), body.tema-escuro .ini-i-perigo:hover:not(:disabled) { background: #3f1519; }


/* ===== Ferramentas (v3.59.0) ===== */
.ferr-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ferr-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ferr-res { background: var(--card-bg, #fff); border: 1px solid var(--border); border-left: 4px solid #0078d4; border-radius: 10px; padding: 10px 12px; }
.ferr-res b { display: block; font-size: 22px; color: var(--text, #1e293b); }
.ferr-res span { font-size: 12px; color: var(--text-muted, #6c757d); }
.ferr-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ferr-tab { border: 1px solid var(--border); background: var(--card-bg, #fff); color: var(--text, #1e293b); border-radius: 20px; padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ferr-tab.ativa { background: #0078d4; border-color: #0078d4; color: #fff; font-weight: 600; }
.ferr-filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.ferr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ferr-card { background: var(--card-bg, #fff); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); display: flex; flex-direction: column; }
.ferr-card-desc { opacity: .6; }
.ferr-card-topo { display: flex; gap: 12px; padding: 12px 14px; cursor: pointer; }
.ferr-card-txt { min-width: 0; flex: 1; }
.ferr-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #eef2f6; }
.ferr-thumb-vazio { display: flex; align-items: center; justify-content: center; font-size: 28px; }
.ferr-titulo { font-weight: 700; font-size: 14px; color: var(--text, #1e293b); overflow-wrap: anywhere; }
.ferr-sub { font-size: 12px; color: var(--text-muted, #6c757d); overflow-wrap: anywhere; }
.ferr-cod { font-size: 12px; font-family: monospace; color: var(--text-muted, #6c757d); overflow-wrap: anywhere; }
.ferr-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #e9ecef; color: #495057; margin-right: 4px; }
.ferr-tag-dano { background: #fff3cd; color: #8a6d00; }
.ferr-tag-desc { background: #f8d7da; color: #842029; }
.ferr-tag-mix { background: #d1e7dd; color: #0f5132; }
.ferr-quant { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 14px 10px; }
.ferr-q { text-align: center; background: rgba(127, 127, 127, .08); border-radius: 8px; padding: 6px 2px; }
.ferr-q b { display: block; font-size: 18px; }
.ferr-q span { font-size: 10px; color: var(--text-muted, #6c757d); }
.ferr-acoes { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--border); margin-top: auto; }
.ferr-acoes .btn { padding: 7px 10px; font-size: 13px; }
.ferr-vazio { text-align: center; padding: 50px 16px; color: var(--text-muted, #6c757d); }
.ferr-linha { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: default; }
.ferr-linha:last-child { border-bottom: 0; }
.ferr-hist { display: flex; flex-direction: column; }
.ferr-h { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ferr-h-ico { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.ferr-h3 { font-size: 14px; margin: 16px 0 6px; color: var(--text, #1e293b); }
.ferr-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ferr-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ferr-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 9px 0; cursor: pointer; }
.ferr-aviso { background: #fff3cd; color: #664d03; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }
.ferr-fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.ferr-foto { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.ferr-foto img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.ferr-foto button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.ferr-foto-env { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-muted, #6c757d); }
.ferr-res-lista { border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; max-height: 220px; overflow: auto; }
.ferr-res-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.ferr-res-item:last-child { border-bottom: 0; }
.ferr-res-item:active, .ferr-res-item:hover { background: rgba(0, 120, 212, .08); }
@media (max-width: 600px) {
    .ferr-grid { grid-template-columns: 1fr; }
    .ferr-form { grid-template-columns: 1fr; }
    .ferr-form > div { grid-column: 1 / -1 !important; }
    .ferr-acoes { flex-wrap: wrap; }
    .ferr-acoes .btn { flex: 1 1 auto; }
}

/* ===== Ferramentas v3.60.0: requisições, calibração, grupos ===== */
.ferr-badge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 10px; background: #dc3545; color: #fff; font-size: 11px; font-weight: 700; text-align: center; margin-left: 4px; }
.ferr-tab.ativa .ferr-badge { background: #fff; color: #0078d4; }
.ferr-alerta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff3cd; color: #664d03; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; cursor: pointer; }
.ferr-alerta-erro { background: #f8d7da; color: #842029; }
.ferr-clicavel { cursor: pointer; }
.ferr-clicavel:active, .ferr-clicavel:hover { background: rgba(0, 120, 212, .06); }

/* ===== v3.63.0: botões de ação perigosa (baixa, descarte, excluir) com contraste ===== */
.btn.btn-perigo, button.btn-perigo { background: #c82333 !important; border-color: #c82333 !important; color: #fff !important; font-weight: 600; }
.btn.btn-perigo:hover, button.btn-perigo:hover { background: #a71d2a !important; border-color: #a71d2a !important; }
.btn.btn-perigo:active, button.btn-perigo:active { background: #8f1823 !important; }
