#signature-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

#signature-toggle button {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#pdf-overlay {
    pointer-events: none;
}

#pdf-overlay.active {
    pointer-events: auto;
}

#signature-spots img {
    pointer-events: none;
}

#drawing-area {
    border: 1px solid #ccc;
    cursor: crosshair;
}

.flex.gap-4 {
    gap: 1rem;
}

canvas {
    display: block;
}

/* Estilos para o menu lateral */
.sidebar {
    transition: transform 0.3s ease-in-out;
    z-index: 50;
    background-color: white;
    border-right: 1px solid #e5e7eb;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #4b5563;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
}

.sidebar-link:hover {
    color: #1f2937;
    background-color: #f3f4f6;
}

.sidebar-link.active {
    color: white;
    background-color: #3b82f6;
}

.sidebar-header {
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-category {
    color: #6b7280;
}

@media (min-width: 768px) {
    .md\:ml-64 {
        margin-left: 16rem;
    }
    
    .md\:translate-x-0 {
        transform: translateX(0);
    }
    
    .md\:hidden {
        display: none;
    }
}

/* Estilos para o dashboard */
.dashboard-section {
    transition: all 0.3s ease-in-out;
}

.dashboard-section.hidden {
    display: none;
}

/* Estilização das tabelas do dashboard */
.dashboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.dashboard-table th {
    background-color: #f9fafb;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.dashboard-table th, 
.dashboard-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.dashboard-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Containers de cards para dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.stat-card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Botões de navegação do dashboard */
.nav-button {
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.nav-button:hover {
    transform: translateY(-1px);
}

.nav-button.active {
    background-color: #3b82f6;
    color: white;
}

/* Badges para status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-yellow {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-red {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Área de drop zone aprimorada */
#drop-zone {
    transition: all 0.3s ease;
}

#drop-zone:hover {
    background-color: #f3f4f6;
    border-color: #6b7280;
}

#drop-zone.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Botões de ação nas tabelas */
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-button:hover {
    transform: translateY(-1px);
}

.action-button.primary {
    background-color: #3b82f6;
    color: white;
}

.action-button.secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.action-button.danger {
    background-color: #ef4444;
    color: white;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    #pdf-container {
        height: 80vh !important; /* Altura responsiva baseada na viewport */
        max-width: 100% !important;
    }
    
    #pdf-iframe {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Ajustes para controles de navegação */
    .mb-4.flex.items-center.justify-center.space-x-4 {
        flex-wrap: wrap;
    }
    
    /* Melhorar tamanho dos botões para toque */
    button {
        padding: 0.5rem 0.75rem !important;
        margin: 0.25rem;
    }
    
    /* Ajustes para dashboard em dispositivos móveis */
    .dashboard-section {
        padding: 0.5rem !important;
    }
    
    .dashboard-table th,
    .dashboard-table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Esconder colunas menos importantes em visualização móvel */
    .dashboard-table .hide-mobile {
        display: none;
    }
    
    /* Ajustar navegação do dashboard para mobile */
    .nav-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Ajustes para os cards de estatísticas */
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    /* Ajustes para o menu lateral em mobile */
    .sidebar {
        width: 80%;
    }
}

/* Garantir que o iframe seja carregado corretamente */
#pdf-iframe {
    display: block;
    background-color: white;
    overflow: auto;
    -webkit-overflow-scrolling: touch; /* Melhora a rolagem em iOS */
}

/* Add this to your existing styles */
.permanent-signature {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

#pdf-container {
    position: relative;
}

/* Estilos para o spinner de carregamento */
#loading-spinner {
    transition: opacity 0.3s ease-in-out;
}

#loading-spinner .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Ajuste para o texto de carregamento */
#loading-spinner div:last-child {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Estilos para drag and drop */
.drag-active {
    background-color: rgba(59, 130, 246, 0.1);
    border: 2px dashed #3b82f6;
    border-radius: 0.5rem;
}

form {
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 0.5rem;
}

/* Otimizações para dispositivos móveis */
@media (max-width: 640px) {
    .container {
        padding: 0.5rem !important;
        max-width: 100% !important;
    }

    #pdf-container {
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100vh - 150px) !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .pdf-navigation-bar {
        padding: 0.25rem !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .bg-white {
        padding: 0.75rem !important;
    }

    #save-signature {
        font-size: 1rem !important;
        padding: 0.5rem 1rem !important;
    }

    /* Reduzir espaçamentos */
    .mb-6 {
        margin-bottom: 0.75rem !important;
    }

    .mb-4 {
        margin-bottom: 0.5rem !important;
    }

    /* Ajustar tamanho dos textos */
    .text-2xl {
        font-size: 1.25rem !important;
    }

    .text-xl {
        font-size: 1.1rem !important;
    }
    
    /* Ajustes para tabelas em telas muito pequenas */
    .dashboard-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Ajustes para espaçamento dos cards */
    .p-4 {
        padding: 0.75rem !important;
    }
    
    /* Permitir quebra de linha em células de tabela para dispositivos muito pequenos */
    @media (max-width: 380px) {
        .dashboard-table td {
            white-space: normal;
        }
    }
}

/* Estilos para badges de status de patrimônios */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}
.status-ativo { background-color: #DEF7EC; color: #03543E; }
.status-inativo { background-color: #E1E1E1; color: #4B5563; }
.status-em_manutencao { background-color: #FEF3C7; color: #92400E; }
.status-aguardando_pecas { background-color: #FCE7F3; color: #831843; }
.status-concluido { background-color: #DBEAFE; color: #1E40AF; }
.status-descarte { background-color: #FEE2E2; color: #991B1B; }

/* Estilos para badges de status de ordens de serviço */
.status-aberta { background-color: #FEE2E2; color: #991B1B; }
.status-em_andamento { background-color: #FEF3C7; color: #92400E; }
.status-aguardando_pecas { background-color: #FCE7F3; color: #831843; }
.status-concluida { background-color: #DBEAFE; color: #1E40AF; }
.status-cancelada { background-color: #E1E1E1; color: #4B5563; }

/* Estilos para badges de prioridade */
.prioridade-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.prioridade-baixa { background-color: #DEF7EC; color: #03543E; }
.prioridade-media { background-color: #DBEAFE; color: #1E40AF; }
.prioridade-alta { background-color: #FEF3C7; color: #92400E; }
.prioridade-urgente { background-color: #FEE2E2; color: #991B1B; }

/* ===== Ajustes de tamanho do topo (apenas dimensões) ===== */
/* Limita a altura da área de checklists para caber dentro da barra (h-24 ~ 6rem) */
.area-checklists-container {
	max-height: 5rem; /* mantém conteúdo visível e dentro da barra */
	overflow: hidden; /* evita que quebre o layout vertical da barra */
}
@media (max-width: 640px) {
	.area-checklists-container {
		max-height: 4rem; /* um pouco mais compacto em telas pequenas */
	}
}
/* Compacta padding/margem do componente de upload apenas quando embutido no topo */
.topbar-upload > .bg-white {
	padding: .25rem !important; /* reduz altura ocupada pelo card */
	margin: 0 !important; /* elimina margem inferior dentro da barra */
}
.topbar-upload #dropzone-contrato {
	padding: .25rem .5rem; /* dropzone mais baixo e clicável */
}

/* ===== Remover ícones do checklist (exibir somente a área) ===== */
#area-checklists i,
#area-checklists svg {
	display: none !important; /* oculta ícones sem afetar conteúdo textual/estrutura */
}

/* ===== Compactação de checklists para caber na barra ===== */
/* Força layout enxuto dos cards quando exibidos na área do topo */
#area-checklists .scroll-container {
	max-height: 5rem !important; /* garante que a área inteira não exceda a barra */
	overflow: hidden !important; /* esconde qualquer excesso vertical */
}
#area-checklists .scroll-container > .flex {
	align-items: center !important; /* alinha os cards verticalmente no centro */
}
#area-checklists .checklist-item {
	height: 4rem !important; /* altura reduzida para caber confortavelmente */
	width: 16rem !important; /* largura moderada para caber mais itens */
	padding: .5rem .75rem !important; /* padding compacto */
	border-width: 1px !important; /* borda mais discreta */
}
/* Remove cabeçalho “CHECKLIST” e blocos detalhados para caber em 1 linha */
#area-checklists .checklist-item .text-center.mb-1 {
	display: none !important;
}
#area-checklists .checklist-item .flex-1.space-y-1 {
	display: none !important; /* esconde patrimônio, comentários, responsável, ações e status */
}
/* Ajusta margem interna para um layout mais compacto */
#area-checklists .checklist-item .ml-6 {
	margin-left: .5rem !important;
}
/* Título do checklist com elipse em uma linha e tipografia reduzida */
#area-checklists .checklist-item h4 {
	font-size: .9rem !important;
	line-height: 1.1 !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
}
/* Data pequena e discreta */
#area-checklists .checklist-item .text-xs.text-gray-500 {
	font-size: .75rem !important;
}
/* Remove efeitos de “papel” no topo para reduzir ruído visual e altura */
#area-checklists .nota-manuscrita::before,
#area-checklists .nota-manuscrita::after {
	display: none !important;
}