/* --- ESTILOS GERAIS E RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: #495057;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* --- TELA DE LOGIN --- */
#tela-login {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #343a40;
}

.login-container .form-group {
    margin-bottom: 20px;
}

.login-container button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-container button:hover {
    background-color: #0056b3;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    display: none;
}

.login-container input[type="email"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-container input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .25);
}

/* --- NOVA ESTRUTURA DE LAYOUT --- */
#app-container {
    display: flex;
    min-height: 100vh;
}

/* --- MENU LATERAL (SIDEBAR) - PARA DESKTOP --- */
#sidebar {
    width: 80px;
    background-color: #06192c;
    /* Sua cor personalizada */
    color: #f8f9fa;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
    position: fixed;
    height: 100%;
    z-index: 1000;
}

#sidebar:hover {
    width: 250px;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 24px;
    white-space: nowrap;
}

/* =========================================== */
/* --- SEPARADORES VISUAIS SIDEBAR --- */
/* =========================================== */

/* Define um estilo padrão para os itens, sem margem inferior */
#sidebar .sidebar-nav li,
#sidebar .sidebar-footer li {
    margin-bottom: 0;
}

/* Adiciona uma borda inferior sutil APÓS itens específicos para criar a separação */
#sidebar .sidebar-nav #li-nav-dashboard,
/* Após o Dashboard */
#sidebar .sidebar-nav li:has(#nav-contratos),
/* Após Contratos (último módulo) */
#sidebar .sidebar-footer li:has(#nav-notificacoes)

/* Após Notificações */
    {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* Linha sutil branca/transparente */
    padding-bottom: 10px;
    /* Espaço abaixo do item antes da linha */
    margin-bottom: 10px;
    /* Espaço abaixo da linha, antes do próximo item */
}

/* Ajuste para o último grupo (Conta/Admin/Sair), se necessário */
#sidebar .sidebar-footer li:has(#btn-abrir-perfil),
#sidebar .sidebar-footer #li-admin-panel {
    /* Pode adicionar margem ou padding aqui se quiser mais espaço antes de "Sair" */
    margin-bottom: 5px;
}

/* Garante que o último item (Sair) não tenha margem/borda extra */
#sidebar .sidebar-footer li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    /* Remove padding extra do último item */
}

/* Garante que os links mantenham o padding interno correto */
#sidebar .nav-link,
#sidebar .sidebar-footer a {
    padding-top: 10px;
    padding-bottom: 10px;
}

#sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar .sidebar-nav {
    flex-grow: 1;
}

#sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #ced4da;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
}

#sidebar ul li a:hover {
    background-color: #335c85;
    color: #fff;
}

/* Seu hover personalizado */
#sidebar ul li a.active {
    background-color: #0d6efd;
    color: #fff;
}

#sidebar ul li a svg,
#sidebar ul li a .nav-icon {
    min-width: 30px;
    margin-right: 20px;
}

#sidebar ul li a .nav-icon {
    width: 28px;
    height: 28px;
}

.nav-text {
    opacity: 0;
    transition: opacity 0.2s ease;
}

#sidebar:hover .nav-text {
    opacity: 1;
    transition-delay: 0.1s;
}

.sidebar-footer {
    padding-bottom: 20px;
}

#btn-logout {
    color: #e74c3c !important;
}

#btn-logout:hover {
    color: #fff !important;
    background-color: #c0392b !important;
}

/* --- CONTEÚDO PRINCIPAL --- */
#main-content {
    flex-grow: 1;
    padding-left: 80px;
    transition: padding-left 0.3s ease;
    width: 100%;
}

/* Oculta o botão hamburger em todas as telas */
#hamburger-btn {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.main-header h1 {
    margin: 0;
}

.main-content-body {
    width: 100%;
}

.lista-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.lista-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.lista-header h2 {
    margin: 0;
    border: none;
    padding: 0;
    font-weight: 500;
}

.btn-principal {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-principal:hover {
    background-color: #0056b3;
}

/* NOVO: Estilo para o botão secundário */
.btn-secundario {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

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


/* --- FILTROS, TABELA E MODAIS --- */
.filtros-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filtros-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filtros-container span {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

.filtro-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #ced4da;
    background-color: #fff;
    color: #495057;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.filtro-btn:hover {
    background-color: #e9ecef;
}

.filtro-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.search-container {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

.input-busca-style {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

th {
    background-color: #f8f9fa;
    font-weight: 500;
    font-size: 14px;
    color: #6c757d;
}

td {
    font-size: 14px;
    white-space: nowrap;
}

.dias-restantes {
    font-weight: 500;
}

.status-span {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-em-dia {
    background-color: #28a745;
}

.status-vence-breve {
    background-color: #ffc107;
    color: #333;
}

.status-atrasado {
    background-color: #dc3545;
}

.status-renovado {
    background-color: #17a2b8;
}

.status-em-renovacao {
    background-color: #6c757d;
}

/* Regra base para todos os botões de ação da tabela */
.btn-editar,
.btn-anexo,
.btn-deletar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

/* Estilos para o botão Editar */
.btn-editar {
    color: #0d6efd;
}

.btn-editar:hover {
    background-color: #e7f1ff;
    color: #0a58ca;
}

/* Estilos para o botão Anexo */
.btn-anexo {
    color: #6c757d;
}

.btn-anexo:hover {
    background-color: #e9ecef;
    color: #212529;
}

/* Estilos para o botão Deletar */
.btn-deletar {
    color: #dc3545;
}

.btn-deletar:hover {
    background-color: #f8d7da;
    color: #721c24;
}

/* Regra para o tamanho do ícone SVG dentro de TODOS os botões de ação */
/* Botões de Ação (Tabela) Melhorados */
.btn-icon {
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

/* Tamanho do ícone */
.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Botão Editar (Azul) */
button[title="Editar"] {
    background-color: #e7f1ff;
    color: #0d6efd;
}

button[title="Editar"]:hover {
    background-color: #0d6efd;
    color: #fff;
}

/* Botão Excluir (Vermelho) */
button[title="Excluir"] {
    background-color: #ffe7e7;
    color: #dc3545;
}

button[title="Excluir"]:hover {
    background-color: #dc3545;
    color: #fff;
}

/* NOVO: Estilo para linhas de tabela clicáveis */
.linha-clicavel {
    cursor: pointer;
}

.linha-clicavel:hover {
    background-color: #f8f9fa;
    /* Um cinza bem claro para feedback visual */
}

/* --- PAGINAÇÃO --- */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #e9ecef;
}

.pagination-button {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pagination-button:hover:not(:disabled) {
    background-color: #06192c;
}

.pagination-button:disabled {
    background-color: #ced4da;
    cursor: not-allowed;
}

#page-info {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

/* --- MODAIS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* --- CONTEÚDO PRINCIPAL --- */
.main-content-body {
    padding: 40px;
    /* Aumentado conforme pedido */
}

/* --- TABELAS ADMIN (Layout Ajustado) --- */
/* Correção: Seletor direto na tabela para garantir que pegue */
.table-wrapper table th:nth-child(1) {
    width: 80px;
    text-align: center;
}

/* ID (Aumentado) */
.table-wrapper table th:nth-child(2) {
    width: auto;
}

/* Espaçamento interno das células */
.table-wrapper table th,
.table-wrapper table td {
    padding: 12px 15px;
    /* Mais respiro */
    vertical-align: middle;
}

/* Garante que o input select de role na tabela fique arrumado */
.select-role-usuario {
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    width: 100%;
}

/* Nome (Flexible) */
.table-wrapper table th:nth-child(3) {
    width: 180px;
    min-width: 180px;
}

/* CNPJ */
.table-wrapper table th:nth-child(4) {
    width: 120px;
    min-width: 120px;
}

/* Data */
.table-wrapper table th:nth-child(5) {
    width: 80px;
    text-align: center;
}

/* Frota */
.table-wrapper table th:nth-child(6) {
    width: 110px;
    text-align: center;
}

/* Status */
.table-wrapper table th:nth-child(7) {
    width: 140px;
    text-align: center;
}

/* Ações */

/* REFORÇO DE ESTILOS DE MODAL */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    text-align: left;
    border: none;
    font-size: 20px;
}

.close-button {
    background: transparent;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
}

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

.btn-cancelar {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

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

.modal-footer .btn-salvar {
    width: auto;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background-color: #007bff;
    color: white;
}

.modal-footer .btn-salvar:hover {
    background-color: #0056b3;
}

.form-group {
    margin-bottom: 15px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-color: #fff;
    cursor: pointer;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #6c757d;
    pointer-events: none;
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-upload-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-upload-button {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background-color: #6c757d;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-block;
}

.file-upload-button:hover {
    background-color: #5a6268;
}

.file-name-display {
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
}

.anexo-atual-display {
    font-size: 14px;
    color: #343a40;
    margin-bottom: 8px;
    font-weight: 500;
    word-break: break-all;
}

/* --- ESTILOS PARA FORMULÁRIO DINÂMICO DE MANUTENÇÃO --- */
.form-row {
    display: flex;

    align-items: flex-end;
}

.form-group.half-width {
    width: 50%;
}

.pecas-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.pecas-section h3 {
    margin-bottom: 15px;
    font-weight: 500;
}

/* Container da linha de peça/serviço */
.peca-item {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

/* Container de cada campo individual na linha (Tipo, Qtd, etc.) */
.peca-item .form-group {
    margin-bottom: 0;
    flex-grow: 1;
    flex-shrink: 1;
}

/* Larguras e crescimento dos campos específicos */
.peca-item .form-group.peca-tipo {
    flex-basis: 120px;
    flex-grow: 0;
}

.peca-item .form-group.peca-qtd {
    flex-basis: 60px;
    flex-grow: 0;
}

.peca-item .form-group.peca-desc {
    flex-grow: 2;
}

.peca-item .form-group.peca-marca {
    flex-grow: 1;
}

.peca-item .form-group.peca-acao {
    flex-basis: 40px;
    flex-grow: 0;
    flex-shrink: 0;
}

/* Força os inputs e selects a preencherem 100% dos seus containers */
.peca-item .form-group input,
.peca-item .form-group select {
    width: 100%;
    box-sizing: border-box;
    /* Garante que padding e borda não quebrem o layout */
}

.btn-adicionar-item {
    background: none;
    border: 1px dashed #ced4da;
    color: #6c757d;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-top: 10px;
}

.btn-adicionar-item:hover {
    background-color: #e9ecef;
    border-color: #6c757d;
}

.btn-remover-item {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    color: #dc3545;
    border-radius: 6px;
    /* Padronizado com outros inputs */
    width: 100%;
    height: 38px;
    /* Mesma altura dos inputs */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    /* Alinha o 'x' verticalmente */
}

.btn-remover-item:hover {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.form-group.half-width {
    width: 100%;
}

.pecas-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.pecas-section h3 {
    margin-bottom: 15px;
    font-weight: 500;
}

.peca-item {
    margin-bottom: 10px;
}

.peca-qtd {
    width: 15%;
}

.peca-desc {
    width: 50%;
    flex-grow: 1;
    /* Permite que a descrição ocupe o espaço restante */
}

.peca-marca {
    width: 25%;
}

.peca-acao {
    width: 40px;
}

.btn-adicionar-item {
    background: none;
    border: 1px dashed #ced4da;
    color: #6c757d;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-top: 10px;
}

.btn-adicionar-item:hover {
    background-color: #e9ecef;
    border-color: #6c757d;
}

.btn-remover-item {
    background: none;
    border: 1px solid #ced4da;
    color: #dc3545;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    padding-bottom: 2px;
    /* Ajuste visual do 'x' */
}

.btn-remover-item:hover {
    background-color: #f8d7da;
    border-color: #dc3545;
}

/* --- ESTILOS DO MENU DE RODAPÉ (MOBILE) --- */
#bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    justify-content: space-around;
    align-items: flex-start;
    /* Alinha itens no topo */
    padding-top: 5px;
    z-index: 1000;
}

.bottom-bar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 10px;
    flex-grow: 1;
    height: 100%;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.bottom-bar-link.active {
    color: #0d6efd;
}

.bottom-bar-link:active {
    /* Efeito de clique */
    background-color: #f0f2f5;
}

.bottom-bar-link svg,
.bottom-bar-link img {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.more-menu {
    display: none;
    position: absolute;
    bottom: 75px;
    /* Acima da barra + um respiro */
    right: 5px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 220px;
    z-index: 1001;
    border: 1px solid #eee;
}

.more-menu.visible {
    display: block;
}

.more-menu a {
    display: flex;
    /* Para alinhar ícone e texto */
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
}

.more-menu a:hover {
    background-color: #f8f9fa;
}

#mobile-btn-logout {
    color: #dc3545;
}

#mobile-more-menu-wrapper {
    position: relative;
}


/* --- RESPONSIVIDADE --- */
@media (max-width: 820px) {

    body,
    html {
        overflow-x: hidden;
    }

    #sidebar {
        display: none;
    }

    #main-content {
        padding-left: 0;
        padding-bottom: 80px;
        /* Espaço para o menu de rodapé */
    }

    #bottom-bar {
        display: flex;
    }

    .container {
        padding: 10px;
    }

    .lista-container {
        padding: 15px;
        box-shadow: none;
        border: 1px solid #eee;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .main-header h1 {
        font-size: 22px;
        text-align: center;
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Aumento de largura específico para o modal de manutenção */
#modal-manutencao .modal-content {
    max-width: 800px;
}

/* --- Estilização Customizada para Campos de Seleção (Dropdowns) --- */

.select-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* Remove a aparência padrão do navegador e aplica nossos estilos */
.select-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Estilos para combinar com os outros inputs do formulário */
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    line-height: 1.5;
    color: #333;
}

/* Adiciona nossa própria seta customizada no canto direito */
.select-wrapper::after {

    font-size: 12px;
    color: #555;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    /* Permite que o clique atravesse a seta e chegue no select */
}

/* --- Estilização para Campos de Texto Maiores (Textarea) --- */

textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    line-height: 1.5;
    color: #333;
    resize: vertical;
    /* Permite que o usuário redimensione a altura */
    min-height: 100px;
    /* Define uma altura mínima */
}

/* =============================================== */
/* --- ESTILOS DAS TAGS DE STATUS (SOLICITAÇÕES) --- */
/* =============================================== */

/* Estilo base para todas as tags de status */
.status-span {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    /* Deixa a tag mais arredondada */
    font-weight: 500;
    font-size: 12px;
    color: #ffffff;
    /* Cor do texto padrão: branca */
    background-color: #6c757d;
    /* Cor de fundo padrão: cinza */
    text-align: center;
    min-width: 100px;
    /* Garante uma largura mínima para a tag */
}

/* Cor específica para o status "Aberto" */
.status-span.status-aberto {
    background-color: #ffc107;
    /* Amarelo/Laranja */
    color: #1f1f1f;
    /* Texto escuro para melhor contraste com o fundo claro */
}

/* Cor específica para o status "Em Andamento" */
.status-span.status-em-andamento {
    background-color: #0d6efd;
    /* Azul */
}

/* Cor específica para o futuro status "Concluído" */
.status-span.status-concluido {
    background-color: #198754;
    /* Verde */
}

/* =============================================== */
/* --- CORES DAS TAGS DE STATUS (DOCUMENTOS) --- */
/* =============================================== */

/* Define a cor de fundo para o status 'Em Dia' (Verde) */
.status-span.status-em-dia {
    background-color: #198754;
    color: #ffffff;
}

/* Define a cor de fundo para o status 'Vence em Breve' (Amarelo) */
.status-span.status-vence-breve {
    background-color: #ffc107;
    color: #1f1f1f;
    /* Texto escuro para melhor contraste */
}

/* Define a cor de fundo para o status 'Atrasado' (Vermelho) */
.status-span.status-atrasado {
    background-color: #dc3545;
    color: #ffffff;
}

/* Estilos para outros status, se houver */
.status-span.status-renovado,
.status-span.status-em_renovacao {
    background-color: #0d6efd;
    /* Azul */
    color: #ffffff;
}

.btn-principal {
    background-color: #0d6efd;
    /* Azul principal do sistema */
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-principal:hover {
    background-color: #0b5ed7;
    /* Azul um pouco mais escuro ao passar o mouse */
}

/* ============================================= */
/* --- ESTILO PARA BOTÕES DE SUCESSO (VERDE) --- */
/* ============================================= */

.btn-success {
    background-color: #198754;
    /* Verde sucesso */
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-success:hover {
    background-color: #157347;
    /* Verde um pouco mais escuro */
}

/* ======================================= */
/* --- SISTEMA DE NOTIFICAÇÕES --- */
/* ======================================= */

/* Posicionamento relativo para o item da sidebar que contém as notificações */
#sidebar .sidebar-footer li:has(#btn-notificacoes) {
    position: relative;
}

/* Estilo do contador (a "bolinha" vermelha) */
.notification-badge {
    position: absolute;
    top: 12px;
    left: 40px;
    /* Posição na sidebar expandida */
    background-color: #dc3545;
    /* Vermelho para destaque */
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid var(--sidebar-bg);
    /* Borda da cor da sidebar para criar um espaçamento */
}

/* Esconde o contador quando estiver zerado (controlado pelo JS) */
.notification-badge.hidden {
    display: none;
}

/* Painel de notificações */
.notifications-panel {
    position: fixed;
    /* MUDANÇA: de 'absolute' para 'fixed' */
    bottom: 120px;
    /* Posição acima do menu do rodapé */
    left: 15px;
    /* Posição a partir da esquerda */
    width: 350px;
    max-height: 400px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    /* Z-index bem alto para ficar acima de tudo */
    display: none;
    /* ALTERAÇÃO: Começa escondido por padrão */
    flex-direction: column;
}

/* Esconde o painel por padrão */
.notifications-panel.hidden {
    display: none;
}

.notifications-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.notifications-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

#lista-notificacoes {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    /* Adiciona scroll se a lista for longa */
}

#lista-notificacoes li {
    border-bottom: 1px solid #e9ecef;
}

#lista-notificacoes li:last-child {
    border-bottom: none;
}

#lista-notificacoes a {
    text-decoration: none;
    color: #495057;
    display: block;
    padding: 15px;
    font-size: 14px;
    transition: background-color 0.2s;
}

#lista-notificacoes a:hover {
    background-color: #f8f9fa;
}

#lista-notificacoes .no-notifications {
    color: #6c757d;
    text-align: center;
    padding: 20px;
    font-style: italic;
}


/* =========================================== */
/* --- ESTILOS DA PÁGINA DE NOTIFICAÇÕES --- */
/* =========================================== */

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background-color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.notification-item:hover {
    background-color: #f9f9f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.notification-icon svg {
    color: #007bff;
    /* Cor do ícone para não lidas */
}

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

.notification-message {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

.notification-timestamp {
    font-size: 0.8rem;
    color: #777;
    margin-top: 4px;
}

/* Estilo para notificações que já foram lidas */
.notification-item.notificacao-lida {
    opacity: 0.7;
    background-color: #f8f9fa;
}

.notification-item.notificacao-lida .notification-icon svg {
    color: #6c757d;
    /* Cor do ícone para lidas */
}

.notification-item.notificacao-lida .notification-message {
    font-weight: 400;
    /* Texto mais leve para lidas */
}

/* =========================================== */
/* --- AJUSTE DE POSIÇÃO DO BADGE DE NOTIFICAÇÃO --- */
/* =========================================== */

/* PASSO 1: Transforma o link da notificação em uma "âncora" de posicionamento
  para o contador que está dentro dele.
*/
#sidebar .nav-link {
    position: relative;
}

/* PASSO 2: Estiliza e posiciona o contador em relação à sua nova âncora.
  Isso substitui o estilo antigo para garantir o posicionamento correto.
*/
#contador-notificacoes {
    position: absolute;
    /* "Solta" o contador */
    top: 8px;
    /* Distância do topo da âncora */
    right: 12px;
    /* Distância da direita da âncora */

    /* Estilos visuais para criar o círculo vermelho */
    background-color: #dc3545;
    /* Vermelho */
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    /* Deixa redondo */
    width: 18px;
    height: 18px;

    /* Centraliza o número dentro do círculo */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Garante que ele não comece escondido por engano */
    transform: scale(1);
    transition: transform 0.2s ease;
}

/* PASSO 3: Garante que a classe .hidden funcione corretamente.
  Quando não há notificações, o JS adiciona esta classe.
*/
#contador-notificacoes.hidden {
    transform: scale(0);
    /* Efeito de "desaparecer" */
}

/* =========================================== */
/* --- ESTILOS DO DASHBOARD (FASE 5) --- */
/* =========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Cria colunas responsivas */
    gap: 20px;
    /* Espaçamento entre os cards */
}

.dashboard-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dashboard-card h2 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 1.1rem;
    color: #333;
}

/* Estilos para o conteúdo dentro dos cards (números, listas, etc.) - a serem adicionados depois */
#dashboard-documentos-content p,
#dashboard-frota-content p {
    color: #666;
    font-style: italic;
}

/* Garante um padding padrão para todos os containers principais dentro do main-content */
#main-content>.content-module>.container {
    padding: 20px;
    /* Ajuste este valor se necessário para combinar com os outros módulos */
}

/* Remove margem superior do header principal dentro dos módulos, se houver */
#main-content .main-header {
    margin-top: 0;
    padding-top: 0;
    /* Garante que não haja padding interno empurrando o H1 para baixo */
}

#content-dashboard .main-content-body {
    padding-top: 10px;
    /* Adiciona um pequeno espaço entre o header e os cards */
}

/* =========================================== */
/* --- AJUSTE TAMANHO ÍCONES SIDEBAR --- */
/* =========================================== */

#sidebar .nav-link svg,
#sidebar .nav-link .nav-icon {
    /* .nav-icon é a classe que usei para o <img> da Frota */
    width: 20px;
    /* Novo tamanho (ajuste conforme preferir) */
    height: 20px;
    /* Novo tamanho (ajuste conforme preferir) */
    margin-right: 12px;
    /* Espaço entre o ícone e o texto (ajuste se necessário) */
    flex-shrink: 0;
    /* Impede que o ícone encolha se o texto for longo */
}

#content-dashboard .main-header {
    /* Adicione ajustes específicos aqui se o estilo geral não resolver */
    margin-bottom: 20px;
}

/* =========================================== */
/* --- AJUSTES DE LAYOUT DASHBOARD (TENTATIVA 2) --- */
/* =========================================== */

/* Garante que o container principal não tenha padding superior extra */
#main-content>#content-dashboard>.container {
    padding-top: 20px;
    /* Mantém o padding lateral e inferior, mas define o superior */
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

/* Zera margens e paddings do header e do H1 DENTRO do dashboard */
#content-dashboard .main-header {
    margin: 0;
    padding: 0;
    /* Adiciona um espaço abaixo do header, antes dos cards */
    margin-bottom: 20px;
}

#content-dashboard .main-header h1 {
    margin: 0;
    padding: 0;
    font-size: 1.5rem;
    /* Pode ajustar o tamanho do título se necessário */
    line-height: 1.2;
    /* Ajusta a altura da linha */
}

/* Garante que o corpo do dashboard não adicione padding superior indesejado */
#content-dashboard .main-content-body {
    padding: 0;
    margin: 0;
}

/* =========================================== */
/* --- AJUSTE FONTE E ALINHAMENTO SIDEBAR --- */
/* =========================================== */

#sidebar .nav-link .nav-text {
    font-size: 0.9rem;
    /* Novo tamanho da fonte (ex: 14px ou 0.9rem - ajuste conforme preferir) */
    /* Opcional: Ajusta o alinhamento vertical se necessário */
    vertical-align: middle;
}

/* Garante alinhamento vertical consistente para SVGs e IMGs */
#sidebar .nav-link svg,
#sidebar .nav-link .nav-icon {
    vertical-align: middle;
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Garante que o link ocupe toda a altura e centralize o conteúdo */
#sidebar .nav-link {
    display: flex;
    /* Usa flexbox para alinhar ícone e texto */
    align-items: center;
    /* Centraliza verticalmente */
    padding-top: 10px;
    /* Ajuste o padding vertical se necessário */
    padding-bottom: 10px;
    /* Ajuste o padding vertical se necessário */
}

/* =========================================== */
/* --- ESTILOS MELHORADOS DASHBOARD (FASE 5) --- */
/* =========================================== */

.dashboard-counts {
    display: flex;
    flex-wrap: wrap;
    /* Permite que os itens quebrem a linha em telas menores */
    gap: 15px;
    /* Espaço entre os itens de contagem */
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    /* Linha separadora */
}

.dashboard-counts div {
    display: flex;
    flex-direction: column;
    /* Coloca o rótulo acima do número */
    align-items: center;
    /* Centraliza */
    background-color: #f8f9fa;
    /* Fundo leve */
    padding: 10px 15px;
    border-radius: 5px;
    min-width: 80px;
    /* Largura mínima */
    text-align: center;
}

.dashboard-counts span {
    font-size: 0.8rem;
    color: #6c757d;
    /* Cinza para o rótulo */
    margin-bottom: 3px;
}

.dashboard-counts strong {
    font-size: 1.4rem;
    font-weight: 700;
    color: #343a40;
    /* Cor principal para o número */
}

/* Cores específicas para alertas */
.dashboard-counts .text-danger {
    color: #dc3545;
}

.dashboard-counts .text-warning {
    color: #ffc107;
}

/* Título das listas */
.dashboard-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
}

/* Estilo básico para as listas */
.dashboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-list li {
    margin-bottom: 8px;
}

/* Estilo para links clicáveis nas listas */
.clickable-list a {
    display: block;
    /* Ocupa toda a largura */
    padding: 5px 8px;
    text-decoration: none;
    color: #007bff;
    /* Cor do link */
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.clickable-list a:hover {
    background-color: #e9ecef;
    /* Fundo no hover */
    color: #0056b3;
}

.clickable-list .list-date,
.clickable-list .list-status {
    font-size: 0.8rem;
    color: #6c757d;
    /* Cinza para info adicional */
    margin-left: 5px;
}

/* Cores específicas para status na lista de veículos */
.clickable-list .list-status.manutenção-vencida {
    color: #dc3545;
    font-weight: 500;
}

.clickable-list .list-status.manutenção-em-alerta {
    color: #ffc107;
    font-weight: 500;
}

.clickable-list .list-status.solicitação-aberta {
    color: #17a2b8;
    font-weight: 500;
}

/* Estilo básico para o botão PDF nas tabelas */
.btn-pdf {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #6c757d;
    /* Cinza */
    transition: color 0.2s ease;
}

.btn-pdf:hover {
    color: #007bff;
    /* Azul no hover */
}

/* =================================================================== */
/* --- MELHORIA: QUEBRA DE LINHA TABELA (v5 - Correção Suave) --- */
/* =================================================================== */

/* 1. Define o layout fixo e a largura total (como na v4) */
#content-veiculo-detalhes .table-wrapper table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

/* 2. Estilos gerais da célula (como na v4) */
#content-veiculo-detalhes .table-wrapper th,
#content-veiculo-detalhes .table-wrapper td {
    padding: 12px 8px;
    vertical-align: top;
    text-align: left;
    border-bottom: 1px solid #eee;
}

/* 3. Larguras fixas para colunas estreitas (como na v4) */
/* Coluna 1: Data */
#content-veiculo-detalhes th:nth-child(1),
#content-veiculo-detalhes td:nth-child(1) {
    width: 13%;
}

/* Coluna 2: Tipo */
#content-veiculo-detalhes th:nth-child(2),
#content-veiculo-detalhes td:nth-child(2) {
    width: 10%;
}

/* Coluna 3: KM Atual */
#content-veiculo-detalhes th:nth-child(3),
#content-veiculo-detalhes td:nth-child(3) {
    width: 12%;
}

/* Coluna 5: Nº OS */
#content-veiculo-detalhes th:nth-child(5),
#content-veiculo-detalhes td:nth-child(5) {
    width: 13%;
}

/* Coluna 6: Ações */
#content-veiculo-detalhes th:nth-child(6),
#content-veiculo-detalhes td:nth-child(6) {
    width: 10%;
    text-align: center;
}

/* 4. Regra ATUALIZADA para a coluna de descrição (a 4ª) */
#content-veiculo-detalhes th:nth-child(4),
#content-veiculo-detalhes td:nth-child(4) {
    /* Define a largura restante (total = 100 - 13 - 10 - 12 - 13 - 10 = 42%) */
    width: 42%;

    /* --- MUDANÇA PRINCIPAL --- */
    /* Remove a regra agressiva 'word-break: break-all' */
    /* Adiciona a regra 'overflow-wrap: break-word', que quebra 
       preferencialmente entre palavras. */
    white-space: normal;
    word-wrap: break-word;
    /* Fallback */
    overflow-wrap: break-word;
    /* Padrão moderno */
}

/* ======================================================== */
/* --- MELHORIA: QUEBRA DE LINHA TABELA SOLICITAÇÕES --- */
/* ======================================================== */

/* 1. Define o layout fixo e a largura total */
/* Usamos um seletor que identifica a tabela pelo seu tbody ID */
#tbody-solicitacoes-container .table-wrapper table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

/* Precisamos adicionar um ID ao <div> pai da tabela de solicitações no HTML */
/* Se não for possível, usaremos um seletor mais genérico */

/* Abordagem Genérica (tentativa 1) - Pode afetar outras tabelas se não formos cuidadosos.
   Vamos tentar uma abordagem mais segura primeiro, assumindo a estrutura do HTML
*/
#content-veiculo-detalhes .lista-container:nth-of-type(2) .table-wrapper table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}


/* 2. Define larguras fixas para as colunas da tabela de solicitações */
/* Coluna 1: Data */
#content-veiculo-detalhes .lista-container:nth-of-type(2) th:nth-child(1),
#content-veiculo-detalhes .lista-container:nth-of-type(2) td:nth-child(1) {
    width: 18%;
}

/* Coluna 2: Status */
#content-veiculo-detalhes .lista-container:nth-of-type(2) th:nth-child(2),
#content-veiculo-detalhes .lista-container:nth-of-type(2) td:nth-child(2) {
    width: 13%;
}

/* Coluna 3: Solicitado Por */
#content-veiculo-detalhes .lista-container:nth-of-type(2) th:nth-child(3),
#content-veiculo-detalhes .lista-container:nth-of-type(2) td:nth-child(3) {
    width: 15%;
}

/* Coluna 4: Descrição (flexível) - Não definimos largura */

/* Coluna 5: Mecânico Responsável */
#content-veiculo-detalhes .lista-container:nth-of-type(2) th:nth-child(5),
#content-veiculo-detalhes .lista-container:nth-of-type(2) td:nth-child(5) {
    width: 15%;
}

/* Coluna 6: Ações */
#content-veiculo-detalhes .lista-container:nth-of-type(2) th:nth-child(6),
#content-veiculo-detalhes .lista-container:nth-of-type(2) td:nth-child(6) {
    width: 15%;
    text-align: center;
}

/* 3. Regra CRUCIAL para a coluna de descrição (a 4ª) */
#content-veiculo-detalhes .lista-container:nth-of-type(2) th:nth-child(4),
#content-veiculo-detalhes .lista-container:nth-of-type(2) td:nth-child(4) {
    /* Largura restante (100 - 18 - 13 - 15 - 15 - 15 = 24%) */
    width: 24%;

    /* Quebra de linha suave */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 4. Regra geral para células (padding, alinhamento) */
#content-veiculo-detalhes .lista-container:nth-of-type(2) .table-wrapper td {
    vertical-align: top;
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
}

/* ======================================================== */
/* --- MELHORIA: QUEBRA DE LINHA TABELA PLANO MANUTENÇÃO --- */
/* ======================================================== */

/* 1. Define o layout fixo e a largura total */
/* Este seletor mira no 4º .lista-container dentro da página de detalhes,
      que é o container do "Plano de Manutenção Preventiva" */
#content-veiculo-detalhes .lista-container:nth-of-type(4) .table-wrapper table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

/* 2. Define larguras fixas para as colunas "estreitas" */
/* Coluna 2: Intervalo KM */
#content-veiculo-detalhes .lista-container:nth-of-type(4) th:nth-child(2),
#content-veiculo-detalhes .lista-container:nth-of-type(4) td:nth-child(2) {
    width: 15%;
    text-align: center;
}

/* Coluna 3: Intervalo Dias */
#content-veiculo-detalhes .lista-container:nth-of-type(4) th:nth-child(3),
#content-veiculo-detalhes .lista-container:nth-of-type(4) td:nth-child(3) {
    width: 15%;
    text-align: center;
}

/* Coluna 4: Status */
#content-veiculo-detalhes .lista-container:nth-of-type(4) th:nth-child(4),
#content-veiculo-detalhes .lista-container:nth-of-type(4) td:nth-child(4) {
    width: 15%;
    text-align: center;
}

/* Coluna 5: Ações */
#content-veiculo-detalhes .lista-container:nth-of-type(4) th:nth-child(5),
#content-veiculo-detalhes .lista-container:nth-of-type(4) td:nth-child(5) {
    width: 10%;
    text-align: center;
}

/* 3. Regra CRUCIAL para a coluna de descrição (a 1ª) */
#content-veiculo-detalhes .lista-container:nth-of-type(4) th:nth-child(1),
#content-veiculo-detalhes .lista-container:nth-of-type(4) td:nth-child(1) {
    /* Largura restante (100 - 15 - 15 - 15 - 10 = 45%) */
    width: 45%;

    /* Quebra de linha suave */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 4. Regra geral para células (padding, alinhamento) */
#content-veiculo-detalhes .lista-container:nth-of-type(4) .table-wrapper td {
    vertical-align: top;
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
}

/* Alinha o texto das colunas 2 e 3 (números) à direita */
#content-veiculo-detalhes .lista-container:nth-of-type(4) td:nth-child(2),
#content-veiculo-detalhes .lista-container:nth-of-type(4) td:nth-child(3) {
    text-align: right;
    padding-right: 15px;
}

/* ======================================================== */
/* --- MELHORIA: QUEBRA DE LINHA TABELA DOCUMENTOS --- */
/* ======================================================== */

/* 1. Define o layout fixo e a largura total */
#content-documentos .table-wrapper table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

/* 2. Define larguras fixas para as colunas "estreitas" */
/* Coluna 2: Categoria */
#content-documentos th:nth-child(2),
#content-documentos td:nth-child(2) {
    width: 15%;
}

/* Coluna 3: Data de Vencimento */
#content-documentos th:nth-child(3),
#content-documentos td:nth-child(3) {
    width: 15%;
}

/* Coluna 4: Dias Restantes */
#content-documentos th:nth-child(4),
#content-documentos td:nth-child(4) {
    width: 15%;
}

/* Coluna 5: Status */
#content-documentos th:nth-child(5),
#content-documentos td:nth-child(5) {
    width: 12%;
    text-align: center;
    /* Centraliza o status */
}

/* Coluna 6: Anexo */
#content-documentos th:nth-child(6),
#content-documentos td:nth-child(6) {
    width: 8%;
    text-align: center;
    /* Centraliza o ícone */
}

/* Coluna 7: Ações */
#content-documentos th:nth-child(7),
#content-documentos td:nth-child(7) {
    width: 10%;
    text-align: center;
    /* Centraliza os ícones */
}

/* 3. Regra CRUCIAL para a coluna "Nome do Documento" (a 1ª) */
#content-documentos th:nth-child(1),
#content-documentos td:nth-child(1) {
    /* Largura restante (100 - 15 - 15 - 15 - 12 - 8 - 10 = 25%) */
    width: 25%;

    /* Quebra de linha suave */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 4. Regra geral para células (padding, alinhamento) */
#content-documentos .table-wrapper td {
    vertical-align: top;
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
}

/* ============================================= */
/* --- CORREÇÃO LAYOUT RESPONSIVO (MOBILE) --- */
/* ============================================= */

/* ============================================= */
/* --- CORREÇÃO LAYOUT RESPONSIVO (MOBILE) --- */
/* ============================================= */

/* ============================================= */
/* --- CORREÇÃO LAYOUT RESPONSIVO (MOBILE) --- */
/* ============================================= */

/* Aplica estas regras apenas em telas com 768px de largura ou menos */
@media (max-width: 768px) {

    /* 1. Adiciona o scroll lateral no container da tabela */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* Melhora a rolagem no iOS */
    }

    /* 2. Força a tabela a ter uma largura mínima.
       Isso garante que ela "estoure" a tela e ative a rolagem.
       Ajuste este valor se 750px for muito ou pouco.
    */
    .table-wrapper table {
        min-width: 980px;
    }

    /* 3. ESTA É A REGRA MAIS IMPORTANTE:
       Impede que o conteúdo das células (como "VENCE EM BREVE" ou "Vencido há 50 d...")
       quebre em várias linhas, o que estava causando a sobreposição.
       Ao forçar uma linha única, a coluna se alarga para caber o conteúdo.
    */
    .table-wrapper th,
    .table-wrapper td {
        white-space: nowrap;
    }
}

/* --- AJUSTE: Controle da Tabela de Documentos (Desktop) v3 (7 Colunas) --- */

.lista-container {
    overflow-x: hidden;
    width: 100%;
}

.lista-container table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.lista-container th,
.lista-container td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    white-space: nowrap;
}

/* --- Controle das 7 Colunas --- */

/* Coluna 1: Nome (Flexível e Truncada) */
.lista-container th:nth-child(1),
.lista-container td:nth-child(1) {
    width: 100%;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Coluna 2: Veículo (Ganhou espaço) */
.lista-container th:nth-child(2),
.lista-container td:nth-child(2) {
    width: 140px;
    /* Mais espaço */
}

/* Coluna 3: Data de Vencimento */
.lista-container th:nth-child(3),
.lista-container td:nth-child(3) {
    width: 110px;
}

/* Coluna 4: Dias Restantes */
.lista-container th:nth-child(4),
.lista-container td:nth-child(4) {
    width: 150px;
}

/* Coluna 5: Status */
.lista-container th:nth-child(5),
.lista-container td:nth-child(5) {
    width: 110px;
}

/* Coluna 6: Anexo */
.lista-container th:nth-child(6),
.lista-container td:nth-child(6) {
    width: 60px;
    text-align: center;
}

/* Coluna 7: Ações */
.lista-container th:nth-child(7),
.lista-container td:nth-child(7) {
    width: 80px;
    text-align: center;
}

/* --- AJUSTE: Tabela (Mobile) v3 (7 Colunas) --- */

@media (max-width: 768px) {

    .lista-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lista-container table {
        /* Largura total menor, pois removemos uma coluna */
        width: 650px;
    }

    /* Remove a truncagem no mobile para a coluna Nome */
    .lista-container td:nth-child(1) {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
    }
}

/* =============================================== */
/* --- OTIMIZAÇÃO DE LAYOUT DA TABELA DE FROTA --- */
/* =============================================== */

/* Fix: Layout Fixo para respeitar porcentagens */
#tabela-veiculos {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    /* Garante que bordas não atrapalhem */
}

/* 1. Placa: 10% */
#tabela-veiculos .col-placa {
    width: 10% !important;
    /* Importante para garantir override */
    white-space: nowrap;
    overflow: hidden;
    /* Evita estourar */
    text-overflow: ellipsis;
}

/* 2. Marca: 15% */
#tabela-veiculos .col-marca {
    width: 15% !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. Modelo: 15% */
#tabela-veiculos .col-modelo {
    width: 15% !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 4. Ano: 10% */
#tabela-veiculos .col-ano {
    width: 10% !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 5. Tipo: 35% (Espaço para textos longos) */
#tabela-veiculos .col-tipo {
    width: 35% !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 6. Ações: 15% */
#tabela-veiculos .col-acoes {
    width: 15% !important;
    white-space: nowrap;
    text-align: right;
    padding-right: 15px;
}

/* --- CORREÇÃO URGENTE: TABELA DE USUÁRIOS (TENANT) --- */
#tabela-usuarios-tenant {
    table-layout: fixed;
    width: 100%;
}

#tabela-usuarios-tenant th:nth-child(1) {
    width: 30%;
}

/* Nome */
#tabela-usuarios-tenant th:nth-child(2) {
    width: 40%;
}

/* Email */
#tabela-usuarios-tenant th:nth-child(3) {
    width: 15%;
}

/* Função */
#tabela-usuarios-tenant th:nth-child(4) {
    width: 15%;
}

/* Ações */

#tabela-usuarios-tenant td {
    white-space: normal !important;
    /* Permite quebrar linha */
    overflow-wrap: break-word;
    /* Quebra palavras longas se necessário */
    word-break: break-word;
    /* Compatibilidade */
    vertical-align: top;
}

/* --- CORREÇÃO DA TABELA DE HISTÓRICO DE ABASTECIMENTO --- */
#tabela-abastecimentos {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

#tabela-abastecimentos th,
#tabela-abastecimentos td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    color: #333;
    font-size: 14px;
    vertical-align: middle;
}

#tabela-abastecimentos td {
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Larguras das colunas */
#tabela-abastecimentos th:nth-child(1) {
    width: 14%;
}

/* Data */
#tabela-abastecimentos th:nth-child(2) {
    width: 14%;
}

/* KM Atual */
#tabela-abastecimentos th:nth-child(3) {
    width: 12%;
}

/* Litros */
#tabela-abastecimentos th:nth-child(4) {
    width: 15%;
}

/* Valor Total */
#tabela-abastecimentos th:nth-child(5) {
    width: 30%;
}

/* Posto */
#tabela-abastecimentos th:nth-child(6) {
    width: 15%;
}

/* Consumo */
#tabela-abastecimentos th:nth-child(6) {
    width: 15%;
}

/* --- DEEP LINKING HIGHLIGHT --- */
@keyframes highlight-fade {
    0% {
        background-color: #fff3cd;
    }

    /* Amarelo */
    100% {
        background-color: transparent;
    }
}

.highlight-row {
    animation: highlight-fade 3s ease-out;
}

/* --- MELHORIA ESTÉTICA DOS BOTÕES DE MODAL (v6) --- */

/* Botão "Sim" (Confirmação de Destruição/Ação) */
#btn-confirm-sim {
    background-color: #e63946 !important;
    /* Vermelho mais moderno/suave */
    border: none !important;
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.3);
    /* Sombra avermelhada */
    transition: all 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 6px;
}

#btn-confirm-sim:hover {
    background-color: #d62828 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(220, 38, 38, 0.4);
}

#btn-confirm-sim:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

/* Botão "Não" (Cancelar) */
#btn-confirm-nao {
    background-color: #f1f5f9 !important;
    /* Cinza bem claro */
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 6px;
}

#btn-confirm-nao:hover {
    background-color: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #334155 !important;
}

/* Botão "Entendido" (Aviso) */
#btn-fechar-aviso {
    background-color: #3b82f6 !important;
    /* Azul moderno */
    border: none !important;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    font-weight: 600;
    border-radius: 6px;
}

#btn-fechar-aviso:hover {
    background-color: #2563eb !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(59, 130, 246, 0.4);
}

/* --- AJUSTES TABELA FROTA (Placa e Tipo) - CORREÇÃO AGRESSIVA --- */
/* Placa: Força largura e remove qualquer truncamento */
#tabela-veiculos .col-placa,
#tabela-veiculos td.col-placa,
#tabela-veiculos th.col-placa,
#tabela-veiculos td:nth-child(1),
#tabela-veiculos th:nth-child(1) {
    width: 160px !important;
    min-width: 160px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Tipo: Alinha à esquerda */
#tabela-veiculos .col-tipo,
#tabela-veiculos td.col-tipo,
#tabela-veiculos th.col-tipo,
#tabela-veiculos td:nth-child(5),
#tabela-veiculos th:nth-child(5) {
    text-align: left !important;
    padding-left: 15px !important;
    width: auto !important;
}

/* --- Botão de Ação Ícone (PDF) --- */
.btn-acao-icon {
    background: none;
    border: none;
    cursor: pointer !important;
    color: #3b82f6;
    /* Azul padrão */
    transition: transform 0.2s;
    padding: 4px;
    border-radius: 4px;
}

.btn-acao-icon:hover {
    transform: scale(1.2);
    background-color: #eff6ff;
}