/* ===== VARIAVEIS ===== */
:root {
    /* Paleta CMC Dashboard */
    --azul-escuro: #1b3a5c;
    --azul-medio: #2d5580;
    --azul-claro: #4472a8;
    --amarelo-pse: #2d8a4e;
    --verde: #16a34a;
    --vermelho: #dc2626;
    --laranja: #d97706;
    --roxo: #7c3aed;
    --teal: #0891b2;
    --cinza-bg: #f0f2f5;
    --cinza-borda: #e0e4ea;
    --cinza-texto: #6b7a8d;
    --branco: #ffffff;
    /* Aliases CMC (uso opcional) */
    --cmc-dark: #1b3a5c;
    --cmc-green: #2d8a4e;
    --accent: #1b6b3a;
    --text: #1a2332;
    --text-dim: #6b7a8d;
    --sombra: 0 2px 12px rgba(0,0,0,0.08);
    --sombra-hover: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 12px;
    --sidebar-w: 220px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--cinza-bg);
    color: #2d3436;
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255,255,255,0.08);
    padding: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.sidebar-subtitle {
    font-size: 10px;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59,130,246,0.2) 0%, rgba(99,102,241,0.15) 100%);
    color: #93c5fd;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.nav-icon {
    font-size: 17px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 11px;
    opacity: 0.5;
    text-align: center;
    background: rgba(0,0,0,0.1);
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--azul-escuro);
    color: white;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 99;
    font-weight: 600;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 16px 18px;
    min-height: 100vh;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-w));
    overflow-x: hidden;
}
.section {
    display: none;
}

.section.active {
    display: block;
    max-width: 100%;
    min-width: 0;
    animation: fadeIn 0.3s ease;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.section-header h1 {
    font-size: 20px;
    color: var(--azul-escuro);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}
.section-actions .search-input { max-width: 200px; }
.section-actions button { padding: 8px 14px; font-size: 13px; }

.today-date {
    font-size: 14px;
    color: var(--cinza-texto);
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: var(--sombra);
}

/* ===== DASHBOARD KPI ROW ===== */
.dash-kpi {
    flex: 1 0 auto;
    min-width: 80px;
    background: #fff;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border-top: 3px solid;
}
.dash-kpi-val {
    display: block;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}
.dash-kpi-lbl {
    display: block;
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-top: 2px;
    white-space: nowrap;
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.card {
    background: white;
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--sombra);
    transition: var(--transition);
    min-width: 0;
    border-left: 4px solid transparent;
}

.card:hover {
    box-shadow: var(--sombra-hover);
    transform: translateY(-2px);
}

.card-blue { border-left-color: var(--azul-claro); }
.card-orange { border-left-color: var(--laranja); }
.card-red { border-left-color: var(--vermelho); }
.card-green { border-left-color: var(--verde); }
.card-purple { border-left-color: var(--roxo); }
.card-teal { border-left-color: var(--teal); }
.card-yellow { border-left-color: #facc15; }

.card-icon { font-size: 32px; }

.card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.card-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--azul-escuro);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.card-label {
    font-size: 12px;
    color: var(--cinza-texto);
    margin-top: 4px;
}

/* ===== PAGINAÇÃO ===== */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--fundo-card, white);
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: -2px;
    font-size: 13px;
}
.pagination-info { color: var(--cinza-texto); }
.pagination-btns { display: flex; align-items: center; gap: 6px; }
.pagination-btns button { min-width: 32px; padding: 4px 8px; }
.pagination-btns button:disabled { opacity: 0.3; cursor: default; }
.pagination-page { font-weight: 600; min-width: 60px; text-align: center; }

/* ===== ALERTAS ===== */
.dashboard-alerts, .dashboard-recent {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--sombra);
    margin-bottom: 20px;
}

.dashboard-alerts h3, .dashboard-recent h3 {
    font-size: 16px;
    color: var(--azul-escuro);
    margin-bottom: 12px;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    border-left: 3px solid;
}

.alert-danger {
    background: #ffeaea;
    border-left-color: var(--vermelho);
    color: #c0392b;
}

.alert-warning {
    background: #fff8e1;
    border-left-color: var(--laranja);
    color: #e67e22;
}

.alert-info {
    background: #e8f4fd;
    border-left-color: var(--azul-claro);
    color: var(--azul-medio);
}

.no-alerts, .no-activity {
    color: var(--cinza-texto);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--cinza-bg);
    border-radius: 8px;
    font-size: 13px;
}

.recent-item .recent-time {
    font-size: 11px;
    color: var(--cinza-texto);
    min-width: 70px;
}

/* ===== SEARCH & FILTER ===== */
.search-input {
    padding: 10px 16px;
    border: 2px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    width: 250px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px rgba(68,114,196,0.15);
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar select {
    padding: 8px 12px;
    border: 2px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--azul-claro);
}

/* ===== BUTTONS ===== */
.btn-primary {
    padding: 10px 20px;
    background: var(--azul-medio);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--azul-escuro);
    transform: translateY(-1px);
}

.btn-cancel {
    padding: 10px 20px;
    background: var(--cinza-bg);
    color: var(--cinza-texto);
    border: 2px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel:hover { background: #e2e6ea; }

.btn-danger {
    padding: 10px 20px;
    background: var(--vermelho);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover { background: #c0392b; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-view { background: #e8f4fd; color: var(--azul-medio); }
.btn-view:hover { background: #d0e9fa; }
.btn-edit { background: #fff3e0; color: #e67e22; }
.btn-edit:hover { background: #ffe0b2; }
.btn-del { background: #ffeaea; color: var(--vermelho); }
.btn-del:hover { background: #ffcccc; }

/* ===== TABLE ===== */
.table-wrapper {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--sombra);
    overflow: auto;
    margin-bottom: 20px;
    max-height: 70vh;
    max-width: 100%;
    min-width: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background: var(--azul-escuro);
    color: white;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--cinza-borda);
    vertical-align: middle;
}

tbody tr:hover {
    background: #f8f9ff;
}

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

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

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-ativo { background: #e8f5e9; color: #2e7d32; }
.badge-inativo { background: #fce4ec; color: #c62828; }
.badge-ferias { background: #e3f2fd; color: #1565c0; }
.badge-afastado { background: #fff3e0; color: #e65100; }
.badge-apto { background: #e8f5e9; color: #2e7d32; }
.badge-inapto { background: #fce4ec; color: #c62828; }
.badge-restricao { background: #fff3e0; color: #e65100; }
.badge-vigente { background: #e8f5e9; color: #2e7d32; }
.badge-vencer { background: #fff3e0; color: #e65100; }
.badge-vencido { background: #fce4ec; color: #c62828; }
.badge-recebido { background: #e8f5e9; color: #2e7d32; }
.badge-pendente { background: #fff3e0; color: #e65100; }
.badge-programada { background: #e3f2fd; color: #1565c0; }
.badge-andamento { background: #fff3e0; color: #e65100; }
.badge-concluida { background: #e8f5e9; color: #2e7d32; }
.badge-cancelada { background: #fce4ec; color: #c62828; }
.badge-aguardando { background: #f3e5f5; color: #7b1fa2; }
.badge-concluido { background: #e8f5e9; color: #2e7d32; }
/* SGI Risk badges */
.badge-trivial { background: #e8f5e9; color: #2e7d32; }
.badge-toleravel { background: #e3f2fd; color: #1565c0; }
.badge-moderado { background: #fff8e1; color: #f57f17; }
.badge-substancial { background: #fff3e0; color: #e65100; }
.badge-intoleravel { background: #fce4ec; color: #b71c1c; }
.badge-aberto, .badge-aberta { background: #fff8e1; color: #f57f17; }
.badge-em_tratamento, .badge-em_analise { background: #e3f2fd; color: #1565c0; }
.badge-encerrado, .badge-encerrada { background: #e8f5e9; color: #2e7d32; }
.badge-entregue { background: #e8f5e9; color: #2e7d32; }
.badge-devolvido { background: #e3f2fd; color: #1565c0; }
.badge-maior { background: #fce4ec; color: #b71c1c; }
.badge-menor { background: #fff8e1; color: #f57f17; }
.badge-observacao { background: #e3f2fd; color: #1565c0; }

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal.hidden { display: none; }

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 95%;
    max-width: 1100px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-sm { max-width: 420px; padding: 24px; }
.modal-md { max-width: 700px; }
.modal-lg { max-width: 1200px; }
.modal-xl { max-width: 1400px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--cinza-borda);
    position: sticky;
    top: 0;
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 1;
}

.modal-header h3 {
    font-size: 18px;
    color: var(--azul-escuro);
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--cinza-texto);
    line-height: 1;
    transition: var(--transition);
}

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

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

#modalBody {
    padding: 24px;
}

/* ===== FORMS IN MODAL ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--azul-escuro);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px rgba(68,114,196,0.15);
}

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

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

.form-actions-modal {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--cinza-borda);
    margin-top: 16px;
}

/* ===== CHECKLIST ===== */
#checklistBody {
    padding: 24px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--cinza-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.checklist-item.done {
    background: #e8f5e9;
}

.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--verde);
}

.checklist-label {
    flex: 1;
    font-size: 14px;
}

.checklist-item.done .checklist-label {
    text-decoration: line-through;
    color: var(--cinza-texto);
}

.checklist-progress {
    margin-top: 16px;
    text-align: center;
}

.checklist-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--cinza-borda);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.checklist-progress-fill {
    height: 100%;
    background: var(--verde);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ===== SUMMARY BOX ===== */
.summary-box {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--sombra);
}

.summary-box h4 {
    font-size: 15px;
    color: var(--azul-escuro);
    margin-bottom: 12px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--cinza-bg);
    border-radius: 8px;
    font-size: 13px;
}

.summary-item strong {
    font-size: 18px;
    color: var(--azul-escuro);
}

/* ===== DETAIL VIEW ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item {
    padding: 10px;
    background: var(--cinza-bg);
    border-radius: 8px;
}

.detail-item label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cinza-texto);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
    margin-bottom: 4px;
}

.detail-item span {
    font-size: 14px;
    color: var(--azul-escuro);
    font-weight: 500;
}

.detail-full {
    grid-column: 1 / -1;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

.toast.hidden { display: none; }
.toast.success { background: var(--verde); color: white; }
.toast.error { background: var(--vermelho); color: white; }
.toast.warning { background: var(--laranja); color: white; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--cinza-texto);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 70px 12px 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-actions {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
    }

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

    /* Tabelas com scroll horizontal em mobile (não quebra colunas) */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-wrapper table {
        min-width: 600px;
    }

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

    .modal-content {
        width: 98%;
        margin: 10px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--azul-escuro) 0%, #0f1b33 50%, #1a3a6e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.login-screen.hidden { display: none; }

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 400px;
    max-width: 95%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: fadeIn 0.5s ease;
}

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

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: contain;
    margin-bottom: 16px;
    background: var(--cinza-bg);
    padding: 8px;
}

.login-header h1 {
    font-size: 22px;
    color: var(--azul-escuro);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: var(--cinza-texto);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--azul-escuro);
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--cinza-borda);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.login-field input:focus {
    outline: none;
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px rgba(68,114,196,0.15);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.5;
    transition: var(--transition);
}

.toggle-pass:hover { opacity: 1; }

.login-error {
    background: #ffeaea;
    color: var(--vermelho);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    border-left: 3px solid var(--vermelho);
}

.login-error.hidden { display: none; }

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--azul-medio);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.login-btn:hover {
    background: var(--azul-escuro);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27,42,74,0.3);
}

.login-btn:disabled {
    background: #a0b0c0;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--cinza-borda);
}

.login-footer p {
    font-size: 12px;
    color: var(--cinza-texto);
}

/* ===== APP CONTAINER ===== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-container.hidden { display: none; }

/* ===== SIDEBAR FOOTER UPDATE ===== */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#loggedUserName {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
}

.btn-change-pass {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-change-pass:hover {
    background: rgba(59,130,246,0.2);
    color: #93c5fd;
    border-color: rgba(59,130,246,0.3);
}

.btn-logout {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(239,68,68,0.2);
    color: #fca5a5;
    border-color: var(--vermelho);
}

.nav-separator {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 10px 16px;
}
.nav-group-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.25);
    padding: 12px 16px 4px;
    margin-top: 2px;
}

/* ===== SIDEBAR GROUPS (colapsáveis) ===== */
.nav-group { margin: 1px 0; }
.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: none;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    user-select: none;
}
.nav-group-toggle:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.nav-group-toggle .nav-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; opacity: 0.8; }
.nav-arrow {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.35;
    transition: transform 0.2s;
}
.nav-group.collapsed .nav-arrow { transform: rotate(-90deg); }
.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-left: 14px;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease;
    border-left: 1px solid rgba(255,255,255,0.06);
    margin-left: 24px;
}
.nav-group.collapsed .nav-group-items {
    max-height: 0;
    padding: 0 0 0 14px;
}
.nav-group-items .nav-item {
    font-size: 12px;
    padding: 7px 12px;
    color: rgba(255,255,255,0.45);
}
.nav-group-items .nav-item:hover { color: rgba(255,255,255,0.85); }
.nav-group-items .nav-item.active {
    color: #93c5fd;
    background: rgba(59,130,246,0.12);
    box-shadow: inset 3px 0 0 #3b82f6;
}
.nav-group-items .nav-item .nav-icon { font-size: 13px; }

/* ===== INFO BOX ===== */
.info-box {
    background: #e8f4fd;
    border-left: 4px solid var(--azul-claro);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--azul-medio);
}

/* ===== FILE UPLOAD ===== */
.file-upload-area {
    border: 2px dashed var(--cinza-borda);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--cinza-bg);
    position: relative;
}

.file-upload-area:hover {
    border-color: var(--azul-claro);
    background: #f0f5ff;
}

.file-upload-area.has-file {
    border-color: var(--verde);
    background: #f0fff4;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.file-upload-text {
    font-size: 13px;
    color: var(--cinza-texto);
}

.file-upload-text strong {
    color: var(--azul-medio);
}

.file-upload-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--verde);
    margin-top: 8px;
}

.file-preview {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--cinza-borda);
}

.file-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 6px;
    object-fit: cover;
}

.file-preview-info {
    flex: 1;
    font-size: 12px;
    color: var(--cinza-texto);
}

.file-preview-info .file-name {
    font-weight: 600;
    color: var(--azul-escuro);
    font-size: 13px;
    word-break: break-all;
}

.btn-remove-file {
    background: var(--vermelho);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-file:hover { background: #c0392b; }

.upload-progress {
    margin-top: 8px;
    width: 100%;
    height: 6px;
    background: var(--cinza-borda);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: var(--azul-claro);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e8f4fd;
    color: var(--azul-medio);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.attachment-link:hover {
    background: #d0e9fa;
}

/* ===== BULK UPLOAD (IA OCR) ===== */
.bulk-dropzone {
    border: 2px dashed #10b981;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: #f0fdf4;
    transition: all 0.2s;
}
.bulk-dropzone:hover,
.bulk-dropzone-over {
    background: #dcfce7;
    border-color: #059669;
}
.bulk-dropzone p {
    margin: 6px 0;
}
.bulk-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
}
.bulk-file-row span:first-child {
    flex: 1;
}
.bulk-progress-box {
    padding: 20px 0;
}
.bulk-progress-box h3 {
    margin-bottom: 14px;
    color: var(--azul-escuro);
}
.bulk-progress {
    width: 100%;
    height: 14px;
    background: #e5e7eb;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 10px;
}
.bulk-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.3s ease;
}
.bulk-progress-log {
    max-height: 200px;
    overflow-y: auto;
    background: #f9fafb;
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    font-family: monospace;
    margin-top: 10px;
}
.bulk-progress-log > div {
    padding: 3px 0;
    border-bottom: 1px solid #eef;
}
.bulk-review-wrapper {
    max-height: 55vh;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin: 12px 0;
}
.bulk-review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.bulk-review-table th,
.bulk-review-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}
.bulk-review-table th {
    background: var(--azul-escuro);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
}
.bulk-review-table input,
.bulk-review-table select {
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: auto;
}
.bulk-review-table tr.confianca-baixa {
    background: #fef3c7;
}
.bulk-review-table tr.confianca-baixa:hover {
    background: #fde68a;
}

/* Tabs de modo (PDF unico vs multiplos arquivos) */
.bulk-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}
.bulk-mode-tab {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}
.bulk-mode-tab:hover {
    color: #111827;
}
.bulk-mode-tab.active {
    background: #fff;
    color: var(--azul-escuro);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Badges de categoria na tabela de split */
.cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.cat-badge.cat-doc {
    background: #dcfce7;
    color: #065f46;
}
.cat-badge.cat-aso {
    background: #fef3c7;
    color: #92400e;
}

/* Linha extra de ASO na tabela de revisao */
.split-aso-extra td {
    background: #fffbeb;
    border-top: none !important;
    padding-top: 2px !important;
    padding-bottom: 6px !important;
}
.split-aso-extra input,
.split-aso-extra select {
    font-size: 11px !important;
    padding: 3px 5px !important;
}

/* Linha extra de Doc (subtipo/titulo) na tabela de revisao */
.split-doc-extra td {
    background: #f0fdf4;
    border-top: none !important;
    padding-top: 2px !important;
    padding-bottom: 6px !important;
}
.split-doc-extra input {
    font-size: 11px !important;
    padding: 3px 5px !important;
}

/* ===== DOSSIE DO FUNCIONARIO (viewFunc modal) ===== */
.func-name-link {
    cursor: pointer;
    color: var(--azul-escuro);
    text-decoration: none;
    transition: color 0.2s;
    text-transform: uppercase;
}
.func-name-link:hover {
    color: var(--azul-claro, #0369a1);
    text-decoration: underline;
}

.dossie-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 16px;
    padding-bottom: 0;
    flex-wrap: wrap;
}
.dossie-tab {
    background: transparent;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dossie-tab:hover {
    color: var(--azul-escuro);
    background: #f3f4f6;
}
.dossie-tab.active {
    color: var(--azul-escuro);
    border-bottom-color: var(--azul-escuro);
    font-weight: 600;
}
.tab-count {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.dossie-tab.active .tab-count {
    background: var(--azul-escuro);
}

.dossie-panel {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 6px;
}

.dossie-group {
    margin-bottom: 18px;
}
.dossie-group h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--azul-escuro);
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dossie-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dossie-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    transition: background 0.15s;
}
.dossie-item:hover {
    background: #f3f4f6;
}
.dossie-item-main {
    flex: 1;
    min-width: 0;
}
.dossie-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 3px;
}
.dossie-item-desc {
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 4px;
    font-style: italic;
}
.dossie-item-meta {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.5;
}
.dossie-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ===== PONTO (Dossie do Funcionario) ===== */
.ponto-resumo-geral {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.ponto-resumo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    color: #fff;
}
.ponto-resumo-header strong { font-size: 15px; }
.ponto-resumo-header div { color: #dbeafe; }
.ponto-resumo-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.ponto-big-stat {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 10px 12px;
}
.ponto-big-stat .label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #dbeafe;
    margin-bottom: 4px;
}
.ponto-big-stat strong {
    font-size: 18px;
    color: #fff;
    font-weight: 700;
}
.ponto-big-stat strong.ponto-pos { color: #bbf7d0; }
.ponto-big-stat strong.ponto-neg { color: #fecaca; }

.ponto-meses-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.ponto-mes-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ponto-mes-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}
.ponto-mes-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--azul-escuro);
}
.ponto-mes-meta {
    font-size: 11px;
    color: #6b7280;
}
.ponto-mes-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.ponto-stat {
    background: #f9fafb;
    border-radius: 6px;
    padding: 6px 8px;
    text-align: center;
}
.ponto-stat .label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 2px;
}
.ponto-stat strong {
    font-size: 13px;
    color: #111827;
}
.ponto-pos { color: #10b981 !important; }
.ponto-neg { color: #ef4444 !important; }

.ponto-dias-grid {
    display: grid;
    grid-template-columns: repeat(31, 1fr);
    gap: 2px;
    margin: 8px 0 6px;
    max-width: 100%;
}
.ponto-day {
    display: inline-block;
    width: 100%;
    aspect-ratio: 1;
    min-width: 14px;
    border-radius: 2px;
    background: #d1d5db;
    transition: transform 0.15s;
    cursor: help;
}
.ponto-day:hover { transform: scale(1.3); }
.ponto-day-no { background: #10b981; }
.ponto-day-fa { background: #ef4444; }
.ponto-day-at { background: #f59e0b; }
.ponto-day-fo { background: #94a3b8; }
.ponto-day-ou { background: #d1d5db; }

.ponto-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 10px;
    color: #6b7280;
    margin-top: 6px;
}
.ponto-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ponto-legend .ponto-day {
    width: 10px;
    min-width: 10px;
    height: 10px;
}

@media (max-width: 768px) {
    .ponto-resumo-stats { grid-template-columns: repeat(2, 1fr); }
    .ponto-mes-stats { grid-template-columns: repeat(3, 1fr); }
}

/* Spinner simples */
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SECAO PONTO (Controle de Ponto Dashboard) ===== */
.ponto-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.ponto-filters > * { flex: 0 0 auto; }
.ponto-filters input[type="text"] { min-width: 140px; flex: 1 1 140px; max-width: 200px; padding: 6px 10px; font-size: 12px; border: 1px solid #d1d5db; border-radius: 6px; }
.ponto-filters select { min-width: 110px; max-width: 160px; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 12px; background: #fff; }
.ponto-filters input[type="date"] { padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 12px; width: 130px; }
.ponto-filters button { padding: 6px 12px; font-size: 12px; }
.ponto-active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ponto-active-filters .filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.ponto-active-filters .filter-tag button {
    background: none;
    border: none;
    color: #1e40af;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}
.ponto-active-filters .filter-tag button:hover { color: #ef4444; }

.ponto-subtabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 0;
}
.ponto-subtab {
    background: transparent;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.15s;
}
.ponto-subtab:hover { color: var(--azul-escuro); background: #f3f4f6; }
.ponto-subtab.active {
    color: var(--azul-escuro);
    border-bottom-color: var(--azul-escuro);
    font-weight: 600;
}

/* ── FATURAMENTO MODULE ── */
.fat-kpi-card {
    transition: transform 0.15s, box-shadow 0.15s;
}
.fat-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
#fatPanel { overflow: hidden; }
/* Opções de vagas no modal Novo Candidato */
.mob-vaga-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(59,130,246,0.06);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}
.mob-vaga-option:hover {
    background: rgba(59,130,246,0.12);
    border-color: var(--azul-claro, #3b82f6);
}
.mob-vaga-option.lotada {
    background: rgba(239,68,68,0.08);
    cursor: not-allowed;
    opacity: 0.55;
}
.mob-vaga-option.lotada:hover {
    background: rgba(239,68,68,0.08);
    border-color: transparent;
}
.mob-vaga-option input[type="checkbox"].mob-vaga-chk {
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;
    flex-shrink: 0;
    accent-color: var(--azul-claro, #3b82f6);
    cursor: inherit;
}
.mob-vaga-option input[type="checkbox"].mob-vaga-chk:focus {
    outline: 2px solid var(--azul-claro, #3b82f6);
    outline-offset: 2px;
    box-shadow: none !important;
}
.mob-vaga-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mob-vaga-titulo {
    font-size: 13px;
    color: var(--azul-escuro, #1e293b);
    line-height: 1.3;
}
.mob-vaga-titulo strong { font-weight: 600; }
.mob-vaga-ghe {
    font-size: 11px;
    color: #64748b;
    background: rgba(100,116,139,0.1);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
}
.mob-vaga-count {
    font-size: 11px;
    color: #64748b;
}
.mob-vaga-livre { color: #10b981; font-weight: 600; }
.mob-vaga-lotada { color: #ef4444; font-weight: 600; }

#fatPanel .card { overflow: hidden; min-width: 0; display: block !important; align-items: initial !important; gap: 0 !important; }
#fatPanel .card h4 { text-align: left; display: block; }
#fatPanel .card[style*="text-align:center"] h4 { text-align: center; }
#fatPanel .card canvas { max-width: 100%; }
#fatPanel .table-wrapper { margin-top: 16px; }
#fatPanel table th { position: sticky; top: 0; z-index: 2; }
#fatPanel .dashboard-cards { margin-bottom: 16px; }

@media (max-width: 1400px) {
    #fatPanel .fat-kpi-row { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 1100px) {
    #fatPanel .fat-kpi-row { grid-template-columns: repeat(3, 1fr) !important; }
    #fatPanel [style*="grid-template-columns:repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #fatPanel [style*="grid-template-columns:1fr 1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 768px) {
    #fatPanel .card { padding: 12px !important; }
    #fatPanel .fat-kpi-row { grid-template-columns: repeat(2, 1fr) !important; }
    #fatPanel [style*="grid-template-columns:repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #fatPanel [style*="grid-template-columns:1fr 1fr 2fr"],
    #fatPanel [style*="grid-template-columns:1fr 1fr;"],
    #fatPanel [style*="grid-template-columns:1fr 1fr}"] {
        grid-template-columns: 1fr !important;
    }
}

.ponto-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
/* KPI Card — estilo Vercel/Linear: border sutil, sem borda-esquerda colorida.
   A cor aparece apenas em um pontinho antes do label. */
.ponto-kpi {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 14px 16px;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    /* overflow: visible pra tooltip de descricao poder escapar do card */
    overflow: visible;
}
.ponto-kpi:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    border-color: #CBD5E1;
}
.ponto-kpi::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #4F46E5;
    opacity: 0.85;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
/* Tooltip de descricao: aparece acima do card ao passar o mouse */
.ponto-kpi[data-tip] { cursor: help; }
.ponto-kpi[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    max-width: 320px;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    white-space: normal;
    text-align: left;
    z-index: 1000;
}
.ponto-kpi[data-tip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}
body.dark-theme .ponto-kpi[data-tip]::after {
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.ponto-kpi.blue::before   { background: #4F46E5; }
.ponto-kpi.green::before  { background: #10B981; }
.ponto-kpi.red::before    { background: #EF4444; }
.ponto-kpi.orange::before { background: #F59E0B; }
.ponto-kpi.yellow::before { background: #F59E0B; }
.ponto-kpi.purple::before { background: #8B5CF6; }
.ponto-kpi-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748B;
    font-weight: 600;
    margin-bottom: 6px;
}
.ponto-kpi-value {
    display: block;
    font-size: 22px;
    color: #0F172A;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.3px;
}
.ponto-kpi-sub {
    display: block;
    font-size: 10px;
    color: #94A3B8;
    margin-top: 4px;
    font-weight: 500;
}

.ponto-charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
    min-width: 0;
}
.ponto-chart-box {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 18px;
    min-width: 0;
    overflow: hidden;
    transition: border-color 0.15s;
}
.ponto-chart-box:hover { border-color: #CBD5E1; }
.ponto-chart-box canvas { max-width: 100% !important; }
.ponto-chart-box h4 {
    margin: 0 0 14px;
    font-size: 13px;
    color: #0F172A;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.ponto-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 8px;
}
.ponto-section-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--azul-escuro);
}

.ponto-tab {
    background: #e2e8f0;
    color: #475569;
}
.ponto-tab:hover {
    background: #cbd5e1;
    color: #1e293b;
}
.ponto-tab.active {
    background: #002060 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0,32,96,.3);
}

.ponto-table-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 65vh;
    max-width: 100%;
    min-width: 0;
}
.ponto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.ponto-table th,
.ponto-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
    white-space: nowrap;
}
.ponto-table th {
    background: var(--azul-escuro);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.3px;
}
.ponto-table .ponto-th-sort { cursor: pointer; user-select: none; transition: background 0.15s; }
.ponto-table .ponto-th-sort:hover { background: #1e40af; }
.ponto-table tr:hover td { background: #f9fafb; }

/* ── Contratos Picker (Gestor Contrato form) ──────────────── */
.contratos-picker {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px 14px;
    max-height: 320px;
    overflow-y: auto;
}
.contratos-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.contratos-picker-header label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    cursor: pointer;
    user-select: none;
}
.contratos-picker-count {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
}
.contratos-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
}
.contratos-picker-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 8px 12px !important;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.contratos-picker-item:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}
.contratos-picker-item input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}
.contratos-picker-item:has(input:checked) {
    background: #dbeafe;
    border-color: #2563eb;
    color: #1e3a8a;
    font-weight: 600 !important;
}
.contratos-picker-item input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.contratos-picker-item:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}
.contratos-picker-item span {
    flex: 1;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    word-break: break-word;
}
.contratos-picker-all input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: #2563eb;
    cursor: pointer;
}
.ponto-table .ponto-bad { background: #fee2e2; color: #991b1b; font-weight: 600; }
.ponto-table .ponto-warn { background: #fef3c7; color: #92400e; font-weight: 600; }
.ponto-table .ponto-info { background: #dbeafe; color: #1e40af; font-weight: 600; }

.ponto-cc-grid {
    display: grid;
    /* Desktop largo: 4 colunas -> 2 linhas pra ate 8 CCs.
       Wraps automatico pra 3/2/1 coluna em telas menores. */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

/* ===== Tabela de Valores de Exames (Clinicas) ===== */
.valex-tbl-wrap {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.valex-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}
.valex-tbl thead {
    position: sticky;
    top: 0;
    background: #1e3a8a;
    color: #fff;
    z-index: 1;
}
.valex-tbl thead th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.valex-tbl tbody tr {
    border-bottom: 1px solid #f1f5f9;
}
.valex-tbl tbody tr:last-child { border-bottom: none; }
.valex-tbl tbody tr:nth-child(even) { background: #f8fafc; }
.valex-tbl tbody td {
    padding: 6px 10px;
    vertical-align: middle;
}
.valex-tbl input[type="text"],
.valex-tbl input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
}
.valex-tbl input[type="text"]:focus,
.valex-tbl input[type="number"]:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}
.valex-tbl input.valex-exame {
    text-transform: uppercase;
}
.valex-tbl .valex-del-cell {
    text-align: center;
}
.valex-tbl tfoot tr {
    background: #f1f5f9;
    border-top: 2px solid #1e3a8a;
}
.valex-tbl tfoot td {
    padding: 10px 12px;
    font-size: 14px;
    color: #0f172a;
}

/* Modo visualizacao (view) — sem inputs, so leitura */
.valex-tbl.valex-view tbody td {
    padding: 8px 12px;
}

body.dark-theme .valex-tbl-wrap,
body.dark-theme .valex-tbl {
    background: #1e293b;
    border-color: #334155;
}
body.dark-theme .valex-tbl tbody tr:nth-child(even) { background: #0f172a; }
body.dark-theme .valex-tbl tbody tr { border-bottom-color: #334155; }
body.dark-theme .valex-tbl input[type="text"],
body.dark-theme .valex-tbl input[type="number"] {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}
body.dark-theme .valex-tbl tfoot tr { background: #0f172a; }
body.dark-theme .valex-tbl tfoot td { color: #f1f5f9; }

/* ===== Badge de area pendente em Mobilizacao ===== */
.mob-stage-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
    cursor: help;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ===== Compliance de Documentacao ===== */
.doc-compliance {
    margin: 16px 0 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}
.compl-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.compl-title h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: var(--azul-escuro, #0B1F3A);
    display: flex;
    align-items: center;
    gap: 8px;
}
.compl-title p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}
.compl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.2fr;
    gap: 16px;
    align-items: stretch;
}
.compl-main {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.compl-big-kpi {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
}
.compl-big-kpi span {
    font-size: 24px;
    margin-left: 2px;
    letter-spacing: 0;
}
.compl-big-label {
    font-size: 12px;
    color: #0f172a;
    font-weight: 600;
    margin-top: 6px;
    line-height: 1.3;
}
.compl-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
}
.compl-kpis {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.compl-kpi {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 10px 14px;
}
.compl-kpi.compl-ok { border-left-color: #16a34a; }
.compl-kpi.compl-warn { border-left-color: #eab308; }
.compl-kpi.compl-err { border-left-color: #dc2626; }
.compl-kpi-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.compl-kpi-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    margin: 2px 0;
}
.compl-kpi-sub {
    font-size: 10px;
    color: #94a3b8;
}
.compl-chart-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
}
.compl-chart-box h4 {
    margin: 0 0 6px;
    font-size: 12px;
    color: #0f172a;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.compl-ranking {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    max-height: 280px;
    overflow-y: auto;
}
.compl-ranking h4 {
    margin: 0 0 10px;
    font-size: 12px;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.compl-ranking ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.compl-ranking li {
    margin-bottom: 10px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.compl-ranking li:hover { background: #f1f5f9; }
.compl-ranking li:last-child { margin-bottom: 0; }
.compl-rank-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.compl-rank-doc {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
}
.compl-rank-count {
    font-size: 11px;
    color: #dc2626;
    font-weight: 600;
}
.compl-rank-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.compl-rank-bar > div {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #dc2626 100%);
    border-radius: 999px;
}
.compl-empty {
    text-align: center;
    color: #16a34a;
    font-size: 12px;
    font-weight: 600;
    margin: 20px 0;
}

@media (max-width: 1200px) {
    .compl-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .compl-grid { grid-template-columns: 1fr; }
}

body.dark-theme .doc-compliance,
body.dark-theme .compl-main,
body.dark-theme .compl-kpi,
body.dark-theme .compl-chart-box,
body.dark-theme .compl-ranking {
    background: #1e293b;
    border-color: #334155;
}
body.dark-theme .compl-main {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
body.dark-theme .compl-big-label,
body.dark-theme .compl-kpi-value,
body.dark-theme .compl-title h3,
body.dark-theme .compl-rank-doc,
body.dark-theme .compl-ranking h4,
body.dark-theme .compl-chart-box h4 { color: #f1f5f9; }
body.dark-theme .compl-ranking li:hover { background: #0f172a; }
body.dark-theme .compl-rank-bar { background: #0f172a; }

/* ===== Combobox com busca (funcionarios) ===== */
.combo-wrap {
    position: relative;
    width: 100%;
}
.combo-input {
    width: 100%;
    padding: 10px 38px 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    text-transform: uppercase;
}
.combo-input::placeholder { text-transform: none; }
.combo-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.combo-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background: #e2e8f0;
    color: #475569;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.combo-clear:hover { background: #cbd5e1; color: #0f172a; }
.combo-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    z-index: 100;
}
.combo-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.combo-item:last-child { border-bottom: none; }
.combo-item:hover,
.combo-item:focus {
    background: #eff6ff;
    outline: none;
}
.combo-item-main {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
    text-transform: uppercase;
}
.combo-item-status {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 4px;
}
.combo-item-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    font-family: 'Consolas', 'Monaco', monospace;
}
.combo-empty,
.combo-more {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}
.combo-more {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

body.dark-theme .combo-input {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}
body.dark-theme .combo-dropdown {
    background: #1e293b;
    border-color: #334155;
}
body.dark-theme .combo-item {
    border-bottom-color: #334155;
}
body.dark-theme .combo-item:hover,
body.dark-theme .combo-item:focus {
    background: #0f172a;
}
body.dark-theme .combo-item-main { color: #f1f5f9; }
body.dark-theme .combo-item-sub { color: #94a3b8; }
body.dark-theme .combo-more { background: #0f172a; border-top-color: #334155; }

/* ===== Metas HE ===== */
.metas-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.metas-chip {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.metas-chip-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.metas-chip-value { font-size: 22px; color: #0f172a; line-height: 1.1; }
.metas-chip-sub { font-size: 10px; color: #94a3b8; }

.metas-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 14px;
    margin-bottom: 10px;
}
.metas-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.metas-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.metas-card-head h4 {
    margin: 0;
    font-size: 15px;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.metas-badge {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.metas-desc {
    margin: 0 0 10px;
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}
.metas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 12px;
    margin-bottom: 12px;
}
.metas-grid > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.metas-grid span {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.metas-grid strong {
    font-size: 14px;
    color: #0f172a;
}
.metas-delta-down { color: #16a34a; }
.metas-delta-up   { color: #dc2626; }
.metas-delta-flat { color: #94a3b8; }
.metas-progress-wrap { margin-top: 6px; }
.metas-progress-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.metas-progress-bar {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.metas-progress-bar > div {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.metas-travas {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.metas-travas span {
    font-size: 10px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 3px 8px;
    border-radius: 4px;
}

body.dark-theme .metas-chip,
body.dark-theme .metas-card {
    background: #1e293b;
    border-color: #334155;
}
body.dark-theme .metas-chip-value,
body.dark-theme .metas-grid strong,
body.dark-theme .metas-card-head h4 { color: #f1f5f9; }
body.dark-theme .metas-progress-bar { background: #0f172a; }
body.dark-theme .metas-travas span { background: #450a0a; border-color: #7f1d1d; color: #fecaca; }
@media (min-width: 1400px) {
    .ponto-cc-grid { grid-template-columns: repeat(4, 1fr); }
}
.ponto-cc-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.ponto-cc-card h4 {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--azul-escuro);
    padding-bottom: 5px;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ponto-cc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.ponto-cc-stats > div {
    background: #f9fafb;
    border-radius: 5px;
    padding: 5px 7px;
    font-size: 11px;
    text-align: center;
}
.ponto-cc-stats > div span {
    display: block;
    font-size: 9px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.ponto-cc-stats > div strong {
    display: block;
    font-size: 12px;
    color: #111827;
}
.ponto-cc-stats > div.ponto-bad strong { color: #991b1b; }
.ponto-cc-stats > div.ponto-warn strong { color: #92400e; }

.ponto-anom-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.ponto-anom-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 11px;
    cursor: pointer;
    color: #374151;
    font-weight: 500;
    transition: all 0.15s;
}
.ponto-anom-chip:hover { background: #e5e7eb; }
.ponto-anom-chip.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
.ponto-anom-chip.active .tab-count { background: #fff; color: #3b82f6; }
.anom-tipo {
    display: inline-block;
    padding: 2px 8px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

/* Tabela-lista dentro do CC card */
.ponto-cc-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.ponto-cc-list td {
    padding: 3px 6px;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.25;
}
.ponto-cc-list td:first-child {
    color: #6b7280;
    font-weight: 500;
}
.ponto-cc-list td:last-child {
    text-align: right;
    font-weight: 700;
    color: #111827;
}
.ponto-cc-list tr:last-child td {
    border-bottom: none;
}

/* Historico de planilhas */
.hist-group { margin-bottom: 10px; }
.hist-list { display: flex; flex-direction: column; gap: 6px; }
.hist-item {
    display: flex;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
}
.hist-item:hover { background: #f3f4f6; }
.hist-item-main { flex: 1; min-width: 0; }
.hist-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hist-item-meta {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.5;
}
.hist-item-actions { display: flex; gap: 4px; flex-shrink: 0; align-items: flex-start; }

/* Badges de operacao (Tecnica / Emergencia) */
.op-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.op-badge.op-tec {
    background: #dbeafe;
    color: #1e40af;
}
.op-badge.op-emer {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== GRAFICOS (Chart.js) ===== */
.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 16px;
    min-width: 0;
}
.chart-box {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    min-width: 0;
    overflow: hidden;
}
.chart-box h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--azul-escuro);
    font-weight: 600;
}
.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.chart-wrapper canvas { max-width: 100% !important; }
@media (max-width: 900px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
    .chart-wrapper {
        height: 240px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cinza-bg); }
::-webkit-scrollbar-thumb { background: #c0c5ce; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a5ae; }

/* ===== THEME TOGGLE BUTTON ===== */
.btn-theme {
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: var(--transition);
    line-height: 1;
}
.btn-theme:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ============================================================
   ===== DARK THEME =====
   Acionado por body.dark-theme. Sobrescreve superficies brancas,
   bordas e cores de texto para um esquema escuro.
   ============================================================ */
body.dark-theme {
    --cinza-bg: #0f172a;
    --cinza-borda: #334155;
    --cinza-texto: #94a3b8;
    --branco: #1e293b;
    --sombra: 0 2px 12px rgba(0,0,0,0.5);
    --sombra-hover: 0 4px 20px rgba(0,0,0,0.6);
    background: #0f172a;
    color: #e2e8f0;
}

/* Texto: headers e numeros que usavam azul-escuro devem ficar claros */
body.dark-theme .section-header h2,
body.dark-theme .card-number,
body.dark-theme .dashboard-alerts h3,
body.dark-theme .dashboard-recent h3,
body.dark-theme .summary-box h4,
body.dark-theme .modal-header h3,
body.dark-theme .form-group label,
body.dark-theme .detail-item span,
body.dark-theme .bulk-progress-box h3,
body.dark-theme .dossie-group h4,
body.dark-theme .ponto-mes-header h4,
body.dark-theme .ponto-chart-box h4,
body.dark-theme .ponto-section-header h4,
body.dark-theme .ponto-cc-card h4,
body.dark-theme .chart-box h4,
body.dark-theme .login-header h1,
body.dark-theme .func-name-link,
body.dark-theme .dossie-tab.active,
body.dark-theme .dossie-tab:hover,
body.dark-theme .ponto-subtab.active,
body.dark-theme .ponto-subtab:hover,
body.dark-theme .bulk-mode-tab.active,
body.dark-theme .dossie-item-title,
body.dark-theme .hist-item-title,
body.dark-theme .ponto-kpi-value,
body.dark-theme .ponto-stat strong,
body.dark-theme .ponto-cc-stats > div strong {
    color: #e2e8f0;
}

/* Superficies brancas -> escuro
   NOTA: usa border-top/right/bottom-color (nao shorthand) pra preservar
   o border-left-color colorido das cards (.card-blue, .ponto-kpi.green, etc) */
body.dark-theme .card,
body.dark-theme .today-date,
body.dark-theme .dashboard-alerts,
body.dark-theme .dashboard-recent,
body.dark-theme .table-wrapper,
body.dark-theme .modal-content,
body.dark-theme .modal-header,
body.dark-theme .summary-box,
body.dark-theme .filter-bar select,
body.dark-theme .chart-box,
body.dark-theme .login-card,
body.dark-theme .ponto-kpi,
body.dark-theme .ponto-chart-box,
body.dark-theme .ponto-table-wrap,
body.dark-theme .ponto-cc-card {
    background: #1e293b;
    color: #e2e8f0;
    border-top-color: #334155;
    border-right-color: #334155;
    border-bottom-color: #334155;
}
/* Para cards sem accent lateral, sobrescreve tambem o border-left */
body.dark-theme .today-date,
body.dark-theme .dashboard-alerts,
body.dark-theme .dashboard-recent,
body.dark-theme .table-wrapper,
body.dark-theme .modal-content,
body.dark-theme .modal-header,
body.dark-theme .summary-box,
body.dark-theme .filter-bar select,
body.dark-theme .chart-box,
body.dark-theme .login-card,
body.dark-theme .ponto-chart-box,
body.dark-theme .ponto-table-wrap,
body.dark-theme .ponto-cc-card {
    border-left-color: #334155;
}

/* Itens secundarios (surface-2) */
body.dark-theme .recent-item,
body.dark-theme .detail-item,
body.dark-theme .checklist-item,
body.dark-theme .bulk-file-row,
body.dark-theme .bulk-progress-log,
body.dark-theme .bulk-review-wrapper,
body.dark-theme .bulk-mode-tabs,
body.dark-theme .dossie-item,
body.dark-theme .hist-item,
body.dark-theme .ponto-stat {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}
/* CC stats grid (se usado) */
body.dark-theme .ponto-cc-stats > div {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}
/* CC list table */
body.dark-theme .ponto-cc-list td {
    border-bottom-color: #334155;
}
body.dark-theme .ponto-cc-list td:first-child { color: #94a3b8; }
body.dark-theme .ponto-cc-list td:last-child { color: #e2e8f0; }
body.dark-theme .dossie-item:hover,
body.dark-theme .hist-item:hover,
body.dark-theme .ponto-table tr:hover td,
body.dark-theme tbody tr:hover {
    background: #334155;
}

/* Inputs, selects, textareas */
body.dark-theme .search-input,
body.dark-theme .form-group input,
body.dark-theme .form-group select,
body.dark-theme .form-group textarea,
body.dark-theme .ponto-filters input[type="text"],
body.dark-theme .ponto-filters input[type="date"],
body.dark-theme .ponto-filters select,
body.dark-theme .bulk-review-table input,
body.dark-theme .bulk-review-table select,
body.dark-theme .login-field input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}
body.dark-theme .search-input::placeholder,
body.dark-theme .form-group input::placeholder,
body.dark-theme .form-group textarea::placeholder,
body.dark-theme .ponto-filters input::placeholder,
body.dark-theme .login-field input::placeholder {
    color: #64748b;
}

/* Tabelas: header ja eh azul-escuro, body precisa ajustar */
body.dark-theme tbody td,
body.dark-theme .ponto-table td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}
body.dark-theme .bulk-review-table th,
body.dark-theme .ponto-table th,
body.dark-theme thead th {
    background: #0b1220;
    color: #e2e8f0;
    border-bottom-color: #334155;
}

/* Botoes cancelar */
body.dark-theme .btn-cancel {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}
body.dark-theme .btn-cancel:hover { background: #475569; }

/* Botoes pequenos (view/edit/del) - cores de fundo tint */
body.dark-theme .btn-view { background: #1e3a5f; color: #93c5fd; }
body.dark-theme .btn-view:hover { background: #1e40af; color: #fff; }
body.dark-theme .btn-edit { background: #422006; color: #fbbf24; }
body.dark-theme .btn-edit:hover { background: #78350f; color: #fff; }
body.dark-theme .btn-del { background: #450a0a; color: #fca5a5; }
body.dark-theme .btn-del:hover { background: #7f1d1d; color: #fff; }

/* Alertas dashboard */
body.dark-theme .alert-danger { background: #450a0a; color: #fca5a5; }
body.dark-theme .alert-warning { background: #422006; color: #fbbf24; }
body.dark-theme .alert-info { background: #1e293b; color: #93c5fd; }

/* Modal backdrop ja eh rgba(0,0,0,0.5) - mantem */

/* Card label / texto cinza em geral ja usa var(--cinza-texto) que esta sobrescrito */

/* Dossie tabs / Ponto subtabs borders */
body.dark-theme .dossie-tabs,
body.dark-theme .ponto-subtabs {
    border-bottom-color: #334155;
}
body.dark-theme .dossie-tab:hover { background: #334155; }
body.dark-theme .ponto-subtab:hover { background: #334155; }
body.dark-theme .dossie-group h4 { border-bottom-color: #334155; }
body.dark-theme .ponto-mes-header { border-bottom-color: #334155; }
body.dark-theme .ponto-cc-card h4 { border-bottom-color: #334155; }
body.dark-theme .ponto-table th,
body.dark-theme .ponto-table td { border-bottom-color: #334155; }

/* Bulk upload dropzone (mantem verde mas escurecido) */
body.dark-theme .bulk-dropzone { background: #052e16; border-color: #10b981; color: #d1fae5; }
body.dark-theme .bulk-dropzone:hover,
body.dark-theme .bulk-dropzone-over { background: #064e3b; }

/* Bulk mode tabs */
body.dark-theme .bulk-mode-tab { color: #94a3b8; }
body.dark-theme .bulk-mode-tab:hover { color: #e2e8f0; }
body.dark-theme .bulk-mode-tab.active { background: #1e293b; }

/* Bulk review - linha confianca baixa */
body.dark-theme .bulk-review-table tr.confianca-baixa { background: #422006; }
body.dark-theme .bulk-review-table tr.confianca-baixa:hover { background: #78350f; }
body.dark-theme .split-aso-extra td { background: #1c1917; }
body.dark-theme .split-doc-extra td { background: #052e16; }

/* Progress bars genericos */
body.dark-theme .bulk-progress,
body.dark-theme .checklist-progress-bar { background: #334155; }

/* Ponto anom chips */
body.dark-theme .ponto-anom-chip {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}
body.dark-theme .ponto-anom-chip:hover { background: #475569; }

/* Ponto badges (bad/warn/info) - tons mais escuros */
body.dark-theme .ponto-table .ponto-bad { background: #450a0a; color: #fca5a5; }
body.dark-theme .ponto-table .ponto-warn { background: #422006; color: #fbbf24; }
body.dark-theme .ponto-table .ponto-info { background: #1e3a5f; color: #93c5fd; }

/* Ponto active filters tag */
body.dark-theme .ponto-active-filters .filter-tag {
    background: #1e3a5f;
    color: #93c5fd;
}
body.dark-theme .ponto-active-filters .filter-tag button { color: #93c5fd; }

/* Dossie item secundario */
body.dark-theme .dossie-item-desc { color: #94a3b8; }
body.dark-theme .dossie-item-meta,
body.dark-theme .hist-item-meta,
body.dark-theme .ponto-mes-meta,
body.dark-theme .ponto-kpi-sub,
body.dark-theme .ponto-kpi-label,
body.dark-theme .ponto-stat .label,
body.dark-theme .ponto-cc-stats > div span { color: #94a3b8; }

/* Checklist done */
body.dark-theme .checklist-item.done { background: #064e3b; }

/* Scrollbar dark */
body.dark-theme ::-webkit-scrollbar-track { background: #0f172a; }
body.dark-theme ::-webkit-scrollbar-thumb { background: #334155; }
body.dark-theme ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Badges de status (manter cores mas escurecer fundo levemente) */
body.dark-theme .badge-ativo,
body.dark-theme .badge-apto,
body.dark-theme .badge-vigente,
body.dark-theme .badge-recebido,
body.dark-theme .badge-concluida,
body.dark-theme .badge-concluido { background: #064e3b; color: #6ee7b7; }
body.dark-theme .badge-inativo,
body.dark-theme .badge-inapto,
body.dark-theme .badge-vencido,
body.dark-theme .badge-cancelada { background: #450a0a; color: #fca5a5; }
body.dark-theme .badge-ferias,
body.dark-theme .badge-programada { background: #1e3a5f; color: #93c5fd; }
body.dark-theme .badge-afastado,
body.dark-theme .badge-restricao,
body.dark-theme .badge-vencer,
body.dark-theme .badge-pendente,
body.dark-theme .badge-andamento { background: #422006; color: #fbbf24; }
body.dark-theme .badge-aguardando { background: #3b0764; color: #c4b5fd; }

/* Login screen - mantem o gradiente azul (ja escuro) */
body.dark-theme .login-screen { background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e293b 100%); }
body.dark-theme .login-header p,
body.dark-theme .login-field label { color: #94a3b8; }
body.dark-theme .login-logo { background: #0f172a; }

/* Info-box (inline styles usam cores claras - override) */
body.dark-theme .info-box {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0;
}

/* Op breakdown (Visao Geral) */
body.dark-theme .op-badge.op-tec { background: #1e3a5f; color: #93c5fd; }
body.dark-theme .op-badge.op-emer { background: #450a0a; color: #fca5a5; }

/* Chart.js canvas nao precisa de filter */
body.dark-theme canvas { filter: none; }

/* ── PLANOS DE AÇÃO — ISHIKAWA 6M ── */
.ishikawa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0;
}
.ishikawa-item {
    border-left: 4px solid var(--ishi-color, #64748b);
    background: #f8fafc;
    border-radius: 6px;
    padding: 10px 12px;
}
.ishikawa-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 12px;
    color: var(--ishi-color, #64748b);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.ishikawa-item textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px;
    font-size: 13px;
    font-family: inherit;
}
.ishi-mao-de-obra { --ishi-color: #2563eb; }
.ishi-maquina { --ishi-color: #7c3aed; }
.ishi-metodo { --ishi-color: #0891b2; }
.ishi-material { --ishi-color: #ca8a04; }
.ishi-meio-ambiente { --ishi-color: #16a34a; }
.ishi-medicao { --ishi-color: #dc2626; }

.plano-acoes-list {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
}
.plano-acao-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fafbfc;
    position: relative;
}
.plano-acao-row:last-child { margin-bottom: 0; }
.plano-acao-row textarea {
    width: 100%;
    min-height: 48px;
    resize: vertical;
    font-family: inherit;
}
.plano-acao-row input, .plano-acao-row select, .plano-acao-row textarea {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
}
.plano-acao-row-meta {
    display: grid;
    grid-template-columns: 1fr 130px 110px;
    gap: 8px;
    align-items: center;
}
.plano-acao-row .btn-remove-acao {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
}

.plano-files-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin: 8px 0;
    transition: border-color .2s;
}
.plano-files-area:hover { border-color: #3b82f6; }
.plano-files-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}
.plano-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
}
.plano-file-item .btn-remove-file {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
}

.badge-eficaz { background: #dcfce7; color: #166534; font-weight: 700; }
.badge-ineficaz { background: #fecaca; color: #991b1b; font-weight: 700; }
.badge-critica { background: #fecaca; color: #991b1b; font-weight: 700; }
.badge-alta { background: #fed7aa; color: #9a3412; }
.badge-media { background: #fef9c3; color: #854d0e; }
.badge-baixa { background: #e0f2fe; color: #0369a1; }

.prazo-vencido { color: #dc2626; font-weight: 700; }
.prazo-proximo { color: #ea580c; font-weight: 600; }

.ishikawa-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
}
.ishikawa-view-item {
    border-left: 4px solid var(--ishi-color, #64748b);
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
}
.ishikawa-view-item strong {
    display: block;
    font-size: 11px;
    color: var(--ishi-color, #64748b);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}

/* Dark theme overrides for Planos de Ação */
body.dark-theme .ishikawa-item { background: #1e293b; }
body.dark-theme .ishikawa-item textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-theme .ishikawa-view-item { background: #1e293b; }
body.dark-theme .plano-acoes-list { border-color: #334155; }
body.dark-theme .plano-acao-row { border-color: #334155; background: #1e293b; }
body.dark-theme .plano-acao-row input, body.dark-theme .plano-acao-row select, body.dark-theme .plano-acao-row textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-theme .plano-files-area { border-color: #334155; }
body.dark-theme .plano-file-item { background: #1e293b; color: #e2e8f0; }
body.dark-theme .badge-eficaz { background: #052e16; color: #86efac; }
body.dark-theme .badge-ineficaz { background: #450a0a; color: #fca5a5; }
body.dark-theme .badge-critica { background: #450a0a; color: #fca5a5; }
body.dark-theme .badge-alta { background: #431407; color: #fdba74; }
body.dark-theme .badge-media { background: #422006; color: #fde047; }
body.dark-theme .badge-baixa { background: #0c4a6e; color: #7dd3fc; }

/* ── INVESTIGAÇÃO DE ACIDENTES — WIZARD ── */
.inv-wizard { display: flex; flex-direction: column; height: 80vh; }
.inv-header { background: #002060; color: #fff; padding: 12px 20px; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.inv-header h3 { margin: 0; font-size: 16px; }
.inv-countdown { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.inv-countdown .cd-badge { padding: 4px 10px; border-radius: 12px; font-size: 12px; }
.cd-ok { background: #dcfce7; color: #166534; }
.cd-warn { background: #fef9c3; color: #854d0e; }
.cd-danger { background: #fed7aa; color: #9a3412; }
.cd-critical { background: #fecaca; color: #991b1b; }
.cd-overdue { background: #1e1e1e; color: #f87171; }

.inv-tabs { display: flex; border-bottom: 2px solid #e2e8f0; flex-shrink: 0; overflow-x: auto; background: #f8fafc; }
.inv-tabs button { padding: 10px 14px; border: none; background: none; cursor: pointer; font-size: 12px; font-weight: 600; color: #64748b; white-space: nowrap; border-bottom: 3px solid transparent; transition: all .2s; }
.inv-tabs button:hover { color: #002060; background: #f0f4ff; }
.inv-tabs button.active { color: #002060; border-bottom-color: #002060; background: #fff; }
.inv-tabs button.tab-done { color: #16a34a; }
.inv-tabs button.tab-done::after { content: ' ✓'; }

.inv-body { flex: 1; overflow-y: auto; padding: 20px; }
.inv-body .inv-section { display: none; }
.inv-body .inv-section.active { display: block; }
.inv-section-title { font-size: 13px; font-weight: 700; color: #002060; text-transform: uppercase; letter-spacing: .5px; margin: 16px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #e2e8f0; }
.inv-section-title:first-child { margin-top: 0; }

.inv-progress { height: 4px; background: #e2e8f0; border-radius: 2px; flex-shrink: 0; }
.inv-progress-bar { height: 100%; background: #002060; border-radius: 2px; transition: width .3s; }

.inv-footer { padding: 12px 20px; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }

.inv-foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 10px 0; }
.inv-foto-card { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #fafbfc; }
.inv-foto-card img { width: 100%; height: 120px; object-fit: cover; }
.inv-foto-card .foto-info { padding: 8px; font-size: 12px; }
.inv-foto-card .foto-desc { margin-top: 4px; color: #64748b; font-size: 11px; }

.inv-testemunha-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fafbfc; position: relative; }
.inv-testemunha-card .btn-remove-test { position: absolute; top: 8px; right: 8px; background: none; border: none; color: #ef4444; cursor: pointer; font-size: 16px; }

.inv-comite-row { display: grid; grid-template-columns: 2fr 1fr 1fr 40px; gap: 8px; margin-bottom: 8px; align-items: center; }
.inv-comite-row input { padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 4px; font-size: 13px; }

/* Dark theme */
body.dark-theme .inv-header { background: #0f172a; }
body.dark-theme .inv-tabs { background: #1e293b; border-color: #334155; }
body.dark-theme .inv-tabs button { color: #94a3b8; }
body.dark-theme .inv-tabs button.active { color: #93c5fd; border-bottom-color: #93c5fd; background: #0f172a; }
body.dark-theme .inv-body { background: #0f172a; }
body.dark-theme .inv-section-title { color: #93c5fd; border-color: #334155; }
body.dark-theme .inv-foto-card { border-color: #334155; background: #1e293b; }
body.dark-theme .inv-testemunha-card { border-color: #334155; background: #1e293b; }
body.dark-theme .inv-comite-row input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark-theme .inv-progress { background: #334155; }
body.dark-theme .inv-footer { border-color: #334155; }
body.dark-theme .cd-ok { background: #052e16; color: #86efac; }
body.dark-theme .cd-warn { background: #422006; color: #fde047; }
body.dark-theme .cd-danger { background: #431407; color: #fdba74; }
body.dark-theme .cd-critical { background: #450a0a; color: #fca5a5; }
body.dark-theme .cd-overdue { background: #1a1a1a; color: #f87171; }

