.toggle-checkbox:checked + .toggle-track {
    background-color: #3b82f6;
}

.toggle-checkbox:checked + .toggle-track .toggle-dot {
    transform: translateX(20px);
}

.toggle-checkbox:focus-visible + .toggle-track {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* DataTable - forcar centralizacao das colunas de valores */
table.dataTable th.text-center,
table.dataTable td.text-center {
    text-align: center !important;
}
/* Mini Meeting - CSS Customizado */
/* Estilos complementares ao TailwindCSS */

/* Estilos para Tabs */
.tab-button {
    transition: all 0.2s ease-in-out;
}

.tab-button.active {
    border-bottom-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* Variáveis CSS para cores personalizadas */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --dark-color: #1f2937;
}

/* Dashboard - Cards por status (pastel – usado em Kanban e outros contextos) */
.dashboard-status-card { box-sizing: border-box; }
.dashboard-card-lavender { background-color: #f3e8ff; }
.dark .dashboard-card-lavender { background-color: rgba(139, 92, 246, 0.15); }
.dashboard-icon-lavender { background-color: rgba(124, 58, 237, 0.2); color: #6d28d9; }
.dark .dashboard-icon-lavender { background-color: rgba(139, 92, 246, 0.25); color: #a78bfa; }

.dashboard-card-blue { background-color: #dbeafe; }
.dark .dashboard-card-blue { background-color: rgba(59, 130, 246, 0.15); }
.dashboard-icon-blue { background-color: rgba(37, 99, 235, 0.2); color: #1d4ed8; }
.dark .dashboard-icon-blue { background-color: rgba(59, 130, 246, 0.25); color: #60a5fa; }

.dashboard-card-peach { background-color: #ffedd5; }
.dark .dashboard-card-peach { background-color: rgba(249, 115, 22, 0.15); }
.dashboard-icon-peach { background-color: rgba(234, 88, 12, 0.2); color: #c2410c; }
.dark .dashboard-icon-peach { background-color: rgba(249, 115, 22, 0.25); color: #fb923c; }

.dashboard-card-green { background-color: #dcfce7; }
.dark .dashboard-card-green { background-color: rgba(34, 197, 94, 0.15); }
.dashboard-icon-green { background-color: rgba(22, 163, 74, 0.2); color: #15803d; }
.dark .dashboard-icon-green { background-color: rgba(34, 197, 94, 0.25); color: #4ade80; }

.dashboard-card-teal { background-color: #ccfbf1; }
.dark .dashboard-card-teal { background-color: rgba(20, 184, 166, 0.15); }
.dashboard-icon-teal { background-color: rgba(13, 148, 136, 0.2); color: #0d9488; }
.dark .dashboard-icon-teal { background-color: rgba(20, 184, 166, 0.25); color: #2dd4bf; }

.dashboard-card-cyan { background-color: #cffafe; }
.dark .dashboard-card-cyan { background-color: rgba(6, 182, 212, 0.15); }
.dashboard-icon-cyan { background-color: rgba(8, 145, 178, 0.2); color: #0e7490; }
.dark .dashboard-icon-cyan { background-color: rgba(6, 182, 212, 0.25); color: #22d3ee; }

/* Dashboard - Status cards com gradiente colorido (ícone à esquerda, texto branco) */
.dashboard-status-card.dashboard-card-lavender { background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%); }
.dashboard-status-card.dashboard-card-blue     { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%); }
.dashboard-status-card.dashboard-card-peach    { background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); }
.dashboard-status-card.dashboard-card-green    { background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%); }
.dashboard-status-card.dashboard-card-teal     { background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%); }
.dashboard-status-card.dashboard-card-cyan     { background: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%); }

.dark .dashboard-status-card.dashboard-card-lavender { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.dark .dashboard-status-card.dashboard-card-blue     { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.dark .dashboard-status-card.dashboard-card-peach    { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
.dark .dashboard-status-card.dashboard-card-green    { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.dark .dashboard-status-card.dashboard-card-teal     { background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%); }
.dark .dashboard-status-card.dashboard-card-cyan     { background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%); }

.dashboard-status-card .dashboard-status-label,
.dashboard-status-card .dashboard-status-value { color: #ffffff; }
.dashboard-status-card .dashboard-status-label { color: rgba(255, 255, 255, 0.85); }

.dashboard-status-card .dashboard-status-icon {
    background-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

/* Dashboard - Colunas do Kanban com o mesmo gradiente dos status cards */
.dashboard-kanban-column.dashboard-card-lavender { background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%); }
.dashboard-kanban-column.dashboard-card-blue     { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%); }
.dashboard-kanban-column.dashboard-card-peach    { background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); }
.dashboard-kanban-column.dashboard-card-green    { background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%); }
.dashboard-kanban-column.dashboard-card-teal     { background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%); }
.dashboard-kanban-column.dashboard-card-cyan     { background: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%); }

.dark .dashboard-kanban-column.dashboard-card-lavender { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.dark .dashboard-kanban-column.dashboard-card-blue     { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.dark .dashboard-kanban-column.dashboard-card-peach    { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
.dark .dashboard-kanban-column.dashboard-card-green    { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.dark .dashboard-kanban-column.dashboard-card-teal     { background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%); }
.dark .dashboard-kanban-column.dashboard-card-cyan     { background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%); }

/* Cabeçalho da coluna Kanban sobre gradiente: ícone, título e contador em branco */
.dashboard-kanban-column.dashboard-card-lavender > div:first-child,
.dashboard-kanban-column.dashboard-card-blue > div:first-child,
.dashboard-kanban-column.dashboard-card-peach > div:first-child,
.dashboard-kanban-column.dashboard-card-green > div:first-child,
.dashboard-kanban-column.dashboard-card-teal > div:first-child,
.dashboard-kanban-column.dashboard-card-cyan > div:first-child {
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

.dashboard-kanban-column.dashboard-card-lavender > div:first-child > span,
.dashboard-kanban-column.dashboard-card-blue > div:first-child > span,
.dashboard-kanban-column.dashboard-card-peach > div:first-child > span,
.dashboard-kanban-column.dashboard-card-green > div:first-child > span,
.dashboard-kanban-column.dashboard-card-teal > div:first-child > span,
.dashboard-kanban-column.dashboard-card-cyan > div:first-child > span {
    color: #ffffff !important;
}

.dashboard-kanban-column.dashboard-card-lavender > div:first-child > span.material-symbols-outlined,
.dashboard-kanban-column.dashboard-card-blue > div:first-child > span.material-symbols-outlined,
.dashboard-kanban-column.dashboard-card-peach > div:first-child > span.material-symbols-outlined,
.dashboard-kanban-column.dashboard-card-green > div:first-child > span.material-symbols-outlined,
.dashboard-kanban-column.dashboard-card-teal > div:first-child > span.material-symbols-outlined,
.dashboard-kanban-column.dashboard-card-cyan > div:first-child > span.material-symbols-outlined {
    background-color: rgba(255, 255, 255, 0.22) !important;
}

.dashboard-kanban-column.dashboard-card-lavender > div:first-child > span:last-child,
.dashboard-kanban-column.dashboard-card-blue > div:first-child > span:last-child,
.dashboard-kanban-column.dashboard-card-peach > div:first-child > span:last-child,
.dashboard-kanban-column.dashboard-card-green > div:first-child > span:last-child,
.dashboard-kanban-column.dashboard-card-teal > div:first-child > span:last-child,
.dashboard-kanban-column.dashboard-card-cyan > div:first-child > span:last-child {
    background-color: rgba(255, 255, 255, 0.25) !important;
}

/* Dashboard Cliente - Gráfico eventos por estado (Chart.js) */
.dashboard-eventos-estados-chart-root {
    position: relative;
    width: 100%;
}

.dashboard-eventos-estados-chart-canvas-outer {
    position: relative;
    width: 100%;
    height: 260px;
    min-height: 220px;
    max-height: 320px;
}

.dashboard-eventos-estados-chart-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Estilos globais */
body {
    line-height: 1.6;
}

/* Nota: Estilos críticos de FOUC e preloader estão em critical.css */

/* Dropdown Menu do Perfil */
#user-profile-menu {
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Validação de Senha - Requisitos */
#senha-requirements li.text-green-600,
#senha-requirements li.text-green-400 {
    text-decoration: line-through;
}

#perfil-confirmar-senha.border-red-500,
#usuario-confirmar-senha.border-red-500 {
    border-color: #ef4444 !important;
}

/* Validação de Senha - Requisitos */
#senha-requirements-usuario li.text-green-600,
#senha-requirements-usuario li.text-green-400 {
    text-decoration: line-through;
}

/* Animações personalizadas */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Estilos para formulários - GLOBAL - APLICADO A TODOS OS INPUTS DO SISTEMA */
input.form-input,
textarea.form-input,
select.form-input,
input[type="text"].form-input,
input[type="email"].form-input,
input[type="password"].form-input,
input[type="number"].form-input,
input[type="tel"].form-input,
.form-input {
    border: 1px solid #9ca3af !important; /* Cinza mais escuro (gray-400) */
    border-radius: 10px !important; /* Um pouco mais arredondado */
}

.form-label {
    @apply block text-sm text-gray-700 mb-1;
}

.form-error {
    @apply text-red-600 text-sm mt-1;
}

/* Validação em modais: só destaque na borda (main.js — sem .form-error para não quebrar layout em linha) */
input.form-input.form-input--invalid,
textarea.form-input.form-input--invalid,
select.form-input.form-input--invalid {
    border-color: #ef4444 !important;
}

.form-success {
    @apply text-green-600 text-sm mt-1;
}

/* Botões personalizados */
.btn-primary {
    background-color: #7f13ec;
    color: white;
    padding: 10px 20px;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #6a0fc9;
}

.btn-secondary {
    @apply bg-gray-600 hover:bg-gray-700 text-white py-2 px-4 rounded-md transition-colors duration-200;
}

.btn-success {
    @apply bg-green-600 hover:bg-green-700 text-white py-2 px-4 rounded-md transition-colors duration-200;
}

.btn-warning {
    @apply bg-yellow-600 hover:bg-yellow-700 text-white py-2 px-4 rounded-md transition-colors duration-200;
}

.btn-danger {
    @apply bg-red-600 hover:bg-red-700 text-white py-2 px-4 rounded-md transition-colors duration-200;
}

/* Cards personalizados */
.card {
    @apply bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow duration-200;
}

.card-header {
    @apply border-b border-gray-200 pb-4 mb-4;
}

.card-title {
    @apply text-lg text-gray-900;
}

/* Tabelas */
.table {
    @apply w-full border-collapse;
}

.table th {
    @apply bg-gray-50 px-6 py-3 text-left text-xs text-gray-500 uppercase tracking-wider border-b border-gray-200;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900 border-b border-gray-200;
}

.table-striped tbody tr:nth-child(even) {
    @apply bg-gray-50;
}

/* Alertas */
.alert {
    @apply p-4 rounded-md mb-4;
    position: relative;
    z-index: 9999 !important;
}

/* Alerts dentro de modais devem ficar acima de tudo */
#evento-alerts,
.modal-alerts {
    position: relative !important;
    z-index: 10000 !important;
}

#evento-alerts .alert,
.modal-alerts .alert {
    position: relative !important;
    z-index: 10000 !important;
}

/* Garantir que alerts dentro do modal de eventos fiquem acima */
#modal-editar-evento #evento-alerts {
    position: relative !important;
    z-index: 10000 !important;
}

#modal-editar-evento #evento-alerts .alert {
    position: relative !important;
    z-index: 10000 !important;
}

.alert-success {
    @apply bg-green-50 border border-green-200 text-green-800;
}

.alert-warning {
    @apply bg-yellow-50 border border-yellow-200 text-yellow-800;
}

.alert-error {
    @apply bg-red-50 border border-red-200 text-red-800;
}

.alert-info {
    @apply bg-blue-50 border border-blue-200 text-blue-800;
}

/* Loading spinner */
.spinner {
    @apply inline-block w-4 h-4 border-2 border-gray-300 border-t-blue-600 rounded-full animate-spin;
}

/* Modal - Usando TailwindCSS */

/* Sistema de Alertas Personalizado */
.custom-alert {
    min-width: 300px;
    max-width: 400px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.custom-alert.show {
    transform: translateX(0);
    opacity: 1;
}

.custom-alert.success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.custom-alert.error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.custom-alert.warning {
    background-color: #fffbeb;
    border: 1px solid #fed7aa;
    color: #d97706;
}

.custom-alert.info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

.custom-alert .alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.custom-alert .alert-content {
    flex: 1;
    font-size: 14px;
}

.custom-alert .alert-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.custom-alert .alert-close:hover {
    opacity: 1;
}

/* Estilos para alertas dentro do modal */
.modal-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.modal-alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.modal-alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fed7aa;
    color: #d97706;
}

.modal-alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

/* Estilos genéricos para formulários */
.form-label {
    display: block;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
}

/* Estilos globais para todos os inputs do sistema */
input.form-input,
textarea.form-input,
select.form-input,
input[type="text"].form-input,
input[type="email"].form-input,
input[type="password"].form-input,
input[type="number"].form-input,
input[type="tel"].form-input,
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #9ca3af !important; /* Cinza mais escuro (gray-400) */
    border-radius: 10px !important; /* Um pouco mais arredondado */
    background-color: #f9fafb;
    font-size: 14px;
    color: #111827;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

input.form-input:focus,
textarea.form-input:focus,
select.form-input:focus,
.form-input:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

select.form-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    border: 1px solid #9ca3af !important; /* Cinza mais escuro */
    border-radius: 10px !important; /* Um pouco mais arredondado */
}

.form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.space-y-4 > div {
    margin-bottom: 20px;
}

.space-y-4 > div:last-child {
    margin-bottom: 0;
}

/* Estilos genéricos para botões */
.btn-primary {
    background-color: #3b82f6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: white;
    color: #6b7280;
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    color: #374151;
}

/* Estilos genéricos para textos de ajuda */
small {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    display: block;
}

/* Estilos genéricos para títulos de modal */
.modal-title {
    font-size: 18px;
    color: #111827;
    margin: 0;
}

/* Estilos genéricos para ações de formulário */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Responsividade adicional */
@media (max-width: 640px) {
    .container {
        @apply px-4;
    }
    
    .grid-cols-1 {
        @apply grid-cols-1;
    }
}

/* Dark mode support */
.dark-mode .form-input {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2); /* Cinza mais escuro no dark mode */
    color: white;
    border-radius: 10px; /* Consistência com o modo claro */
}

.dark-mode .form-input:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #7f13ec;
}

.dark-mode .form-label {
    color: white;
}

.dark-mode .btn-primary {
    background-color: #7f13ec;
}

.dark-mode .btn-primary:hover {
    background-color: #6a0fc9;
}

.dark-mode .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.dark-mode .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.dark-mode select.form-input,
.dark select.form-input,
html.dark select.form-input {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

.dark-mode select.form-input option,
.dark select.form-input option,
html.dark select.form-input option {
    background-color: #191022 !important;
    color: white !important;
}

.dark-mode select.form-input:focus,
.dark select.form-input:focus,
html.dark select.form-input:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: #7f13ec !important;
    color: white !important;
}

/* Estilos para modo escuro do layout admin */
.dark .bg-white {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark .border-gray-200 {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .text-gray-900 {
    color: white;
}

.dark .text-gray-600 {
    color: rgba(255, 255, 255, 0.7);
}

.dark .text-gray-500 {
    color: rgba(255, 255, 255, 0.5);
}

.dark .bg-gray-50 {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Modal em modo escuro */
.dark #modal-usuario .bg-white {
    background-color: #191022;
}

.dark #modal-usuario .dark\:bg-background-dark {
    background-color: #191022;
}

.dark #modal-usuario .text-gray-400 {
    color: rgba(255, 255, 255, 0.6);
}

.dark #modal-usuario .form-input,
.dark .form-input {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2); /* Cinza mais escuro no dark mode */
    color: white;
    border-radius: 10px; /* Consistência com o modo claro */
}

.dark #modal-usuario .form-input:focus,
.dark .form-input:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #7f13ec;
}

/* Estilos específicos para selects no dark mode */
.dark #modal-usuario select.form-input,
.dark select.form-input,
html.dark select.form-input {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.dark #modal-usuario select.form-input option,
.dark select.form-input option,
html.dark select.form-input option {
    background-color: #191022 !important;
    color: white !important;
}

.dark #modal-usuario select.form-input:focus,
.dark select.form-input:focus,
html.dark select.form-input:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: #7f13ec !important;
    color: white !important;
}

/* DataTable em modo escuro */
.dark .dataTables_wrapper table thead th {
    background-color: rgba(255, 255, 255, 0.08) !important; /* Cinza bem claro no dark mode */
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    text-align: left !important; /* Alinhar à esquerda */
    padding: 12px 20px !important;
}

.dark .dataTables_wrapper table tbody td {
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .dataTables_wrapper table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark .dataTables_length select,
.dark .dataTables_filter input {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2) !important; /* Cinza mais escuro no dark mode */
    color: white;
    border-radius: 10px !important; /* Consistência com outros inputs */
}

.dark .dataTables_paginate .paginate_button {
    color: rgba(255, 255, 255, 0.7);
}

.dark .dataTables_paginate .paginate_button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.dark .dataTables_paginate .paginate_button.current {
    background-color: rgba(127, 19, 236, 0.2);
    color: #7f13ec;
    border-color: #7f13ec;
}

.dark .dataTables_length label,
.dark .dataTables_filter label {
    color: rgba(255, 255, 255, 0.7);
}

.dark .dataTables_info {
    color: rgba(255, 255, 255, 0.6);
}

/* Módulo Eventos: garantir contraste em modo escuro */
.dark #eventos-container .form-input,
.dark #eventos-gestao-view .form-input {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.dark #eventos-container select.form-input option,
.dark #eventos-gestao-view select.form-input option {
    background-color: #191022;
    color: #fff;
}

.dark #eventos-container .form-input::placeholder,
.dark #eventos-gestao-view .form-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

/* Utilitários */
.text-truncate {
    @apply truncate;
}

.shadow-hover {
    @apply hover:shadow-lg transition-shadow duration-200;
}

.border-hover {
    @apply hover:border-blue-500 transition-colors duration-200;
}

/* Animações de hover */
.hover-lift {
    @apply hover:-translate-y-1 transition-transform duration-200;
}

.hover-scale {
    @apply hover:scale-105 transition-transform duration-200;
}

/* Estilos para DataTables - CSS Tradicional */
.dataTables_wrapper {
    width: 100%;
    font-size: 14px; /* Tamanho base unificado */
}

.dataTables_length,
.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_length select,
.dataTables_filter input {
    font-size: 14px; /* Unificado */
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: white;
}

.dataTables_length label,
.dataTables_filter label {
    font-size: 14px; /* Unificado */
    color: #374151;
    margin-right: 8px;
}

.dataTables_info {
    margin-top: 1rem;
    font-size: 12px; /* Menor apenas no rodapé */
    color: #6b7280;
}

.dataTables_paginate {
    margin-top: 1rem;
    font-size: 12px; /* Menor apenas no rodapé */
}

.dataTables_paginate .paginate_button {
    padding: 4px 8px;
    margin: 0 4px;
    border-radius: 4px;
    font-size: 12px; /* Menor apenas no rodapé */
    color: #6b7280;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.dataTables_paginate .paginate_button:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.dataTables_paginate .paginate_button.current {
    background-color: #e5e7eb;
    color: #374151;
}

.dataTables_paginate .paginate_button.disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

/* Estilos para tabela */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px; /* Unificado */
}

.table th {
    background-color: #f9fafb;
    padding: 20px 20px;
    text-align: left;
    font-size: 14px; /* Unificado */
    color: #4b5563;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 20px 20px;
    white-space: nowrap;
    font-size: 14px; /* Unificado */
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

.table-striped tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Estilos genéricos para todos os DataTables */
.dataTables_wrapper table {
    font-size: 14px; /* Unificado */
}

/* Padronizar botões de ações dos DataTables (sem cores) */
.dataTables_wrapper .btn-action-edit,
.dataTables_wrapper .btn-action-delete,
.dataTables_wrapper .btn-action-duplicate,
.dataTables_wrapper .btn-action-orcamento,
.dataTables_wrapper .btn-action-toggle,
.dataTables_wrapper .btn-action-fee,
.dataTables_wrapper .btn-action-user {
    color: #4b5563 !important;
    background-color: #f3f4f6 !important;
    border-color: #e5e7eb !important;
}

.dataTables_wrapper .btn-action-edit:hover,
.dataTables_wrapper .btn-action-delete:hover,
.dataTables_wrapper .btn-action-duplicate:hover,
.dataTables_wrapper .btn-action-orcamento:hover,
.dataTables_wrapper .btn-action-toggle:hover,
.dataTables_wrapper .btn-action-fee:hover,
.dataTables_wrapper .btn-action-user:hover {
    color: #374151 !important;
    background-color: #e5e7eb !important;
    border-color: #d1d5db !important;
}

.dark .dataTables_wrapper .btn-action-edit,
.dark .dataTables_wrapper .btn-action-delete,
.dark .dataTables_wrapper .btn-action-duplicate,
.dark .dataTables_wrapper .btn-action-orcamento,
.dark .dataTables_wrapper .btn-action-toggle,
.dark .dataTables_wrapper .btn-action-fee,
.dark .dataTables_wrapper .btn-action-user {
    color: #e5e7eb !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.dark .dataTables_wrapper .btn-action-edit:hover,
.dark .dataTables_wrapper .btn-action-delete:hover,
.dark .dataTables_wrapper .btn-action-duplicate:hover,
.dark .dataTables_wrapper .btn-action-orcamento:hover,
.dark .dataTables_wrapper .btn-action-toggle:hover,
.dark .dataTables_wrapper .btn-action-fee:hover,
.dark .dataTables_wrapper .btn-action-user:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dataTables_wrapper .btn-action-edit *,
.dataTables_wrapper .btn-action-delete *,
.dataTables_wrapper .btn-action-duplicate *,
.dataTables_wrapper .btn-action-orcamento *,
.dataTables_wrapper .btn-action-toggle *,
.dataTables_wrapper .btn-action-fee *,
.dataTables_wrapper .btn-action-user * {
    color: inherit !important;
}

.dataTables_wrapper table thead th {
    font-size: 14px; /* Unificado */
    font-weight: 500;
    color: #4b5563;
    letter-spacing: 0.05em;
    background-color: #f3f4f6 !important; /* Cinza bem claro */
    text-align: left !important; /* Alinhar à esquerda */
    padding: 12px 20px !important;
}

.dataTables_wrapper table tbody td {
    font-size: 14px; /* Unificado */
    color: #111827;
}

/* Grade clara nas linhas e colunas dos DataTables */
.dataTables_wrapper table {
    border-collapse: collapse !important;
}

.dataTables_wrapper table thead th,
.dataTables_wrapper table tbody td {
    border: 1px solid #f3f4f6 !important;
}

/* Última coluna (Ações): centralizada e com largura mínima */
.dataTables_wrapper table thead th:last-child,
.dataTables_wrapper table tbody td:last-child {
    text-align: center !important;
    white-space: nowrap !important;
    width: 1% !important;
}

.dataTables_wrapper table tbody td:last-child .flex {
    justify-content: center !important;
}

/* Ajustes específicos para o DataTable de Eventos */
#eventos-table_wrapper table {
    font-size: 14px;
}

#eventos-table_wrapper table thead th,
#eventos-table_wrapper table tbody td {
    font-size: 14px;
    padding: 10px !important;
}

#eventos-table_wrapper .dataTables_length,
#eventos-table_wrapper .dataTables_filter {
    font-size: 14px;
}

#eventos-table_wrapper .dataTables_info,
#eventos-table_wrapper .dataTables_paginate,
#eventos-table_wrapper .dataTables_paginate .paginate_button {
    font-size: 12px;
}

/* Ajustes para controles do DataTable */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    font-size: 14px; /* Unificado */
}

.dataTables_wrapper .dataTables_info {
    font-size: 12px; /* Menor apenas no rodapé */
    color: #6b7280;
}

.dataTables_wrapper .dataTables_paginate {
    font-size: 12px; /* Menor apenas no rodapé */
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    font-size: 12px; /* Menor apenas no rodapé */
    color: #6b7280;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #374151;
}

/* Estilos adicionais para melhorar a aparência */
.dataTables_wrapper .dataTables_length select {
    font-size: 14px; /* Unificado */
    padding: 4px 8px;
    border: 1px solid #9ca3af !important; /* Cinza mais escuro */
    border-radius: 10px !important; /* Um pouco mais arredondado */
}

.dataTables_wrapper .dataTables_filter input {
    font-size: 14px; /* Unificado */
    padding: 4px 8px;
    margin: 5px;
    border: 1px solid #9ca3af !important; /* Cinza mais escuro */
    border-radius: 10px !important; /* Um pouco mais arredondado */
}

/* Melhorar espaçamento dos controles */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-size: 14px; /* Unificado */
    color: #4b5563;
    margin-right: 8px;
}

/* Forçar padding nas células de todos os DataTables */
.dataTables_wrapper table th,
.dataTables_wrapper table td {
    padding: 20px !important;
}

/* Override do DataTable padrão */
table.dataTable thead th,
table.dataTable tbody td {
    padding: 10px !important;
}

/* Sobrescrever classes TailwindCSS de todos os DataTables */
.dataTables_wrapper table th[class*="px-"],
.dataTables_wrapper table td[class*="px-"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.dataTables_wrapper table th[class*="py-"],
.dataTables_wrapper table td[class*="py-"] {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* Indicador de processamento do DataTable */
.dataTables_processing {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 20px 30px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    font-size: 14px !important;
    color: #374151 !important;
    z-index: 1000 !important;
}

.dataTables_processing:before {
    content: '' !important;
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    border: 2px solid #e5e7eb !important;
    border-top: 2px solid #3b82f6 !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   LAYOUT E RESPONSIVIDADE DO DATATABLE
   ======================================== */

/* Garantir que o DataTable ocupe toda a largura */
.dataTables_wrapper {
    width: 100% !important;
}

.dataTables_wrapper table {
    width: 100% !important;
    table-layout: auto !important;
}

/* Layout responsivo dos controles */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 1rem !important;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex !important;
    align-items: center !important;
    margin-right: 8px !important;
}

.dataTables_wrapper .dataTables_length select {
    margin-left: 8px !important;
    margin-right: 10px !important;
    padding: 4px 2rem 4px 8px !important; /* Mais padding à direita para a seta */
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    min-width: 80px;
    width: auto;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px;
}

.dark .dataTables_wrapper .dataTables_length select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 8px !important;
    padding: 4px 8px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
}

/* Botões de ação compactos */
.dataTables_wrapper table td:last-child {
    padding: 8px 12px !important;
    white-space: nowrap !important;
}

.dataTables_wrapper table td:last-child .flex {
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
}

/* Layout responsivo da paginação */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    display: flex !important;
    align-items: center !important;
    margin-top: 1rem !important;
}

.dataTables_wrapper .dataTables_info {
    font-size: 14px !important;
    color: #6b7280 !important;
}

.dataTables_wrapper .dataTables_paginate {
    justify-content: flex-end !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 8px 12px !important;
    margin: 0 2px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    background: white !important;
    color: #374151 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f3f4f6 !important;
    border-color: #9ca3af !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #e5e7eb !important;
    color: #374151 !important;
    border-color: #9ca3af !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    background: #f9fafb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
}

/* Modo escuro para botões de paginação */
.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #7f13ec !important;
    color: white !important;
    border-color: #7f13ec !important;
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    cursor: not-allowed !important;
}

/* Select2 - estado de carregamento (bloqueado) */
.select2-container.select2-loading .select2-selection {
    pointer-events: none;
    opacity: 0.6;
}

.select2-container.select2-loading .select2-selection__arrow {
    opacity: 0.6;
}

.select2-loading {
    pointer-events: none;
    opacity: 0.6;
}

/* ========================================
   SETAS DE ORDENAÇÃO DO DATATABLE
   ======================================== */

/* Cabeçalhos ordenáveis - garantir espaço para as setas */
.dataTables_wrapper table thead th.sorting,
.dataTables_wrapper table thead th.sorting_asc,
.dataTables_wrapper table thead th.sorting_desc {
    position: relative;
    cursor: pointer;
    user-select: none;
    padding-right: 30px !important; /* Espaço para a seta */
}

/* Garantir que as setas do DataTables sejam visíveis */
.dataTables_wrapper table thead th.sorting:before,
.dataTables_wrapper table thead th.sorting:after {
    display: block !important;
    opacity: 0.3;
}

.dataTables_wrapper table thead th.sorting_asc:before,
.dataTables_wrapper table thead th.sorting_asc:after {
    display: block !important;
}

.dataTables_wrapper table thead th.sorting_desc:before,
.dataTables_wrapper table thead th.sorting_desc:after {
    display: block !important;
}

/* Estilizar setas do DataTables */
.dataTables_wrapper table thead th.sorting:before {
    content: '▲';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #9ca3af;
    opacity: 0.3;
}

.dataTables_wrapper table thead th.sorting:after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%) translateY(2px);
    font-size: 10px;
    color: #9ca3af;
    opacity: 0.3;
}

/* Setas quando ordenado ASC */
.dataTables_wrapper table thead th.sorting_asc:before {
    content: '▲';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #7f13ec;
    opacity: 1;
}

.dataTables_wrapper table thead th.sorting_asc:after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%) translateY(2px);
    font-size: 10px;
    color: #9ca3af;
    opacity: 0.3;
}

/* Setas quando ordenado DESC */
.dataTables_wrapper table thead th.sorting_desc:before {
    content: '▲';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #9ca3af;
    opacity: 0.3;
}

.dataTables_wrapper table thead th.sorting_desc:after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%) translateY(2px);
    font-size: 10px;
    color: #7f13ec;
    opacity: 1;
}

/* Hover nos cabeçalhos ordenáveis */
.dataTables_wrapper table thead th.sorting:hover {
    background-color: #f9fafb;
}

.dataTables_wrapper table thead th.sorting:hover:before,
.dataTables_wrapper table thead th.sorting:hover:after {
    opacity: 0.6;
}

/* Modo escuro */
.dark .dataTables_wrapper table thead th.sorting:before,
.dark .dataTables_wrapper table thead th.sorting:after {
    color: rgba(255, 255, 255, 0.5);
}

.dark .dataTables_wrapper table thead th.sorting_asc:before {
    color: #7f13ec;
}

.dark .dataTables_wrapper table thead th.sorting_desc:after {
    color: #7f13ec;
}

/* Cabeçalhos não ordenáveis */
.dataTables_wrapper table thead th.sorting_disabled {
    cursor: default;
    padding-right: 20px !important;
}

.dataTables_wrapper table thead th.sorting_disabled:before,
.dataTables_wrapper table thead th.sorting_disabled:after {
    display: none !important;
}

/* ========================================
   MATERIAL SYMBOLS ICONS
   ======================================== */

.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24
}

.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

/* ========================================
   SIDEBAR MOBILE
   ======================================== */

@media (max-width: 1023px) {
    .sidebar-mobile-hidden {
        transform: translateX(-100%);
    }
    
    .sidebar-mobile-show {
        transform: translateX(0);
    }
}

/* ========================================
   LAYOUT ADMINISTRATIVO - SCROLL FIXO
   ======================================== */

/* Garantir que body não tenha scroll */
body {
    overflow: hidden;
    height: 100vh;
}

/* Sidebar sempre fixo */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    transition: width 0.3s ease-in-out;
}

/* Estado collapsed da sidebar (desktop) - apenas ícones */
@media (min-width: 1024px) {
    #sidebar.sidebar-collapsed {
        width: 5rem; /* w-20 - apenas espaço para ícones */
    }
    
    /* Textos ocultos quando collapsed */
    #sidebar.sidebar-collapsed .sidebar-text {
        opacity: 0;
        max-width: 0;
        overflow: hidden;
        white-space: nowrap;
        transition: opacity 0.2s ease-in-out 0.1s, max-width 0.3s ease-in-out;
    }
    
    #sidebar.sidebar-collapsed .sidebar-logo-text {
        opacity: 0;
        max-width: 0;
        overflow: hidden;
        white-space: nowrap;
        transition: opacity 0.2s ease-in-out 0.1s, max-width 0.3s ease-in-out;
    }
    
    /* Submenu oculto quando collapsed */
    #sidebar.sidebar-collapsed .submenu-container {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.2s ease-in-out, max-height 0.3s ease-in-out;
    }
    
    /* Chevron oculto quando collapsed */
    #sidebar.sidebar-collapsed .menu-item-toggle .material-symbols-outlined:last-child {
        opacity: 0;
        width: 0;
        overflow: hidden;
        transition: opacity 0.2s ease-in-out, width 0.3s ease-in-out;
    }
    
    /* Estado expanded - hover */
    #sidebar.sidebar-collapsed:hover {
        width: 16rem; /* w-64 - largura completa */
    }
    
    #sidebar.sidebar-collapsed:hover .sidebar-text {
        opacity: 1;
        max-width: 200px;
    }
    
    #sidebar.sidebar-collapsed:hover .sidebar-logo-text {
        opacity: 1;
        max-width: 200px;
    }
    
    #sidebar.sidebar-collapsed:hover .submenu-container {
        opacity: 1;
        max-height: 1000px;
    }
    
    #sidebar.sidebar-collapsed:hover .menu-item-toggle .material-symbols-outlined:last-child {
        opacity: 1;
        width: auto;
    }
    
    /* Garantir que submenu expandido permaneça visível */
    #sidebar.sidebar-collapsed .submenu-container.block {
        opacity: 1;
        max-height: 1000px;
    }
    
    /* Centralizar ícones quando collapsed - remover padding e centralizar */
    #sidebar.sidebar-collapsed nav a,
    #sidebar.sidebar-collapsed nav button,
    #sidebar.sidebar-collapsed nav .menu-item-toggle {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100%;
        position: relative;
    }
    
    /* Remover padding-left inline quando collapsed - usar seletor mais específico */
    #sidebar.sidebar-collapsed nav a[style*="padding-left"],
    #sidebar.sidebar-collapsed nav button[style*="padding-left"],
    #sidebar.sidebar-collapsed nav .menu-item-toggle[style*="padding-left"] {
        padding-left: 0 !important;
    }
    
    /* Centralizar todos os ícones - garantir alinhamento perfeito */
    #sidebar.sidebar-collapsed nav a .material-symbols-outlined:first-of-type,
    #sidebar.sidebar-collapsed nav button .material-symbols-outlined:first-of-type,
    #sidebar.sidebar-collapsed nav .menu-item-toggle .material-symbols-outlined:first-of-type {
        margin-left: auto !important;
        margin-right: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 24px !important;
        height: 24px !important;
        flex-shrink: 0 !important;
    }
    
    /* Garantir que textos e outros elementos fiquem ocultos quando collapsed */
    #sidebar.sidebar-collapsed nav .sidebar-text {
        display: none !important;
    }
    
    #sidebar.sidebar-collapsed:hover nav .sidebar-text {
        display: block !important;
    }
    
    #sidebar.sidebar-collapsed:hover nav a .sidebar-text,
    #sidebar.sidebar-collapsed:hover nav button .sidebar-text {
        display: inline-block !important;
    }
    
    /* Quando expandido, restaurar comportamento normal */
    #sidebar.sidebar-collapsed:hover nav a .material-symbols-outlined:first-of-type,
    #sidebar.sidebar-collapsed:hover nav button .material-symbols-outlined:first-of-type,
    #sidebar.sidebar-collapsed:hover nav .menu-item-toggle .material-symbols-outlined:first-of-type {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Quando expandido, voltar ao comportamento normal */
    #sidebar.sidebar-collapsed:hover nav a,
    #sidebar.sidebar-collapsed:hover nav button,
    #sidebar.sidebar-collapsed:hover nav .menu-item-toggle {
        justify-content: flex-start !important;
    }
    
    #sidebar.sidebar-collapsed:hover nav a[style*="padding-left"],
    #sidebar.sidebar-collapsed:hover nav button[style*="padding-left"] {
        padding-left: inherit !important;
    }
    
    /* Logo centralizado quando collapsed */
    #sidebar.sidebar-collapsed .flex.items-center.gap-2 {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    
    #sidebar.sidebar-collapsed:hover .flex.items-center.gap-2 {
        justify-content: flex-start;
    }
    
    /* Centralizar ícone do logo quando collapsed */
    #sidebar.sidebar-collapsed .sidebar-icon-collapsed,
    #sidebar.sidebar-collapsed .sidebar-icon-default {
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Botão travar menu: colapsado = só ícone centralizado */
    #sidebar.sidebar-collapsed .sidebar-pin-btn .sidebar-text {
        opacity: 0;
        max-width: 0;
        overflow: hidden;
        white-space: nowrap;
    }
    #sidebar.sidebar-collapsed:hover .sidebar-pin-btn .sidebar-text {
        opacity: 1;
        max-width: 200px;
    }
    #sidebar.sidebar-collapsed .sidebar-pin-btn {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    #sidebar.sidebar-collapsed:hover .sidebar-pin-btn {
        justify-content: center;
    }
    
    /* Centralizar botão de logout quando collapsed */
    #sidebar.sidebar-collapsed .flex.flex-col.gap-2 a {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    #sidebar.sidebar-collapsed:hover .flex.flex-col.gap-2 a {
        justify-content: flex-start !important;
    }
    
    /* Logo: quando collapsed, ocultar imagem e mostrar apenas ícone */
    #sidebar.sidebar-collapsed .sidebar-logo-img {
        display: none;
    }
    
    #sidebar.sidebar-collapsed:hover .sidebar-logo-img {
        display: block;
    }
    
    /* Ícone sempre visível quando collapsed (quando tem logo) */
    #sidebar.sidebar-collapsed .sidebar-icon-collapsed {
        display: block;
    }
    
    #sidebar.sidebar-collapsed:hover .sidebar-icon-collapsed {
        display: none;
    }
    
    /* Quando não collapsed, ocultar ícone collapsed */
    #sidebar:not(.sidebar-collapsed) .sidebar-icon-collapsed {
        display: none;
    }
    
    /* Ícone padrão (sem logo) - sempre visível quando collapsed */
    #sidebar.sidebar-collapsed .sidebar-icon-default {
        display: block;
    }
    
    #sidebar:not(.sidebar-collapsed) .sidebar-icon-default {
        display: block;
    }
}

/* Em mobile, sidebar pode ter scroll se necessário */
@media (max-width: 1023px) {
    #sidebar {
        z-index: 50;
    }
    
    /* Em mobile, não aplicar collapsed - sempre largura completa */
    #sidebar.sidebar-collapsed {
        width: 16rem !important; /* w-64 */
    }
    
    #sidebar.sidebar-collapsed .sidebar-text,
    #sidebar.sidebar-collapsed .sidebar-logo-text {
        opacity: 1 !important;
        max-width: none !important;
    }
    
    #sidebar.sidebar-collapsed .submenu-container {
        opacity: 1 !important;
        max-height: none !important;
    }
    
    #sidebar.sidebar-collapsed .menu-item-toggle .material-symbols-outlined:last-child {
        opacity: 1 !important;
        width: auto !important;
    }
    
    /* Em mobile, margin sempre zero */
    .admin-main-container {
        margin-left: 0 !important;
    }
}

/* Em desktop, ajustar margin do container principal */
@media (min-width: 1024px) {
    .admin-main-container {
        margin-left: 5rem; /* w-20 - largura collapsed (80px) */
        transition: margin-left 0.3s ease-in-out;
        width: calc(100% - 5rem); /* Usar todo o espaço disponível quando collapsed */
        max-width: none;
    }
    
    /* Quando sidebar expandida (hover), ajustar margin via JavaScript */
    .admin-main-container.sidebar-expanded {
        margin-left: 16rem; /* w-64 - largura expanded (256px) */
        width: calc(100% - 16rem); /* Ajustar largura quando expandida */
    }
    
    /* Garantir que o container principal use todo o espaço disponível */
    .admin-main-container > * {
        max-width: 100%;
    }
    
    /* Quando collapsed, permitir que o conteúdo use mais espaço */
    .admin-main-container:not(.sidebar-expanded) main .max-w-7xl {
        max-width: calc(100% - 2rem); /* Usar quase todo o espaço disponível */
        transition: max-width 0.3s ease-in-out;
    }
    
    /* Quando expanded, ajustar max-width */
    .admin-main-container.sidebar-expanded main .max-w-7xl {
        max-width: calc(100% - 2rem); /* Manter mesmo cálculo, o margin-left já ajusta */
    }
    
    /* Garantir que o main use todo o espaço disponível */
    .admin-main-container main {
        width: 100%;
        max-width: 100%;
    }
}

/* Header fixo no topo */
.admin-main-container header {
    position: sticky;
    top: 0;
    z-index: 30;
    background-color: white;
}

.dark .admin-main-container header {
    background-color: #191022;
}

/* Main com scroll apenas no conteúdo */
main {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Customizar scrollbar do main */
main::-webkit-scrollbar {
    width: 8px;
}

main::-webkit-scrollbar-track {
    background: transparent;
}

main::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

main::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Scrollbar em modo escuro */
.dark main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.dark main::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar scrollbar customizada */
#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.dark #sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.dark #sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   DATATABLE RESPONSIVE
   ======================================== */

/* Estilos para tabela responsiva */
.dataTables_wrapper .dtr-details {
    width: 100%;
}

.dataTables_wrapper .dtr-details li {
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 0;
}

.dataTables_wrapper .dtr-details li:last-child {
    border-bottom: none;
}

.dataTables_wrapper .dtr-details .dtr-title {
    color: #374151;
    margin-right: 8px;
    display: inline-block;
    min-width: 100px;
}

.dataTables_wrapper .dtr-details .dtr-data {
    color: #6b7280;
}

/* Modo escuro para detalhes responsivos */
.dark .dataTables_wrapper .dtr-details li {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark .dataTables_wrapper .dtr-details .dtr-title {
    color: rgba(255, 255, 255, 0.9);
}

.dark .dataTables_wrapper .dtr-details .dtr-data {
    color: rgba(255, 255, 255, 0.7);
}

/* Botão de controle responsivo */
.dataTables_wrapper table tbody td.control {
    cursor: pointer;
    text-align: center;
    position: relative;
}

.dataTables_wrapper table tbody td.control:before {
    content: '+';
    font-size: 20px;
    color: #6b7280;
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: #f9fafb;
}

.dataTables_wrapper table tbody tr.dtr-expanded td.control:before {
    content: '-';
    background-color: #e5e7eb;
}

.dark .dataTables_wrapper table tbody td.control:before {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
}

.dark .dataTables_wrapper table tbody tr.dtr-expanded td.control:before {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Ajustes para mobile */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .dataTables_wrapper .dataTables_length select {
        min-width: 80px;
        width: auto;
        padding-right: 32px !important; /* Espaço para a seta */
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.5rem center;
        background-size: 12px;
    }
    
    .dark .dataTables_wrapper .dataTables_length select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ocultar texto "resultados por página" no mobile */
    .dataTables_wrapper .dataTables_length label .mobile-hide-text {
        display: none !important;
    }
    
    /* Simplificar label - mostrar apenas número e select */
    .dataTables_wrapper .dataTables_length label {
        font-size: 14px;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    /* Ocultar texto "resultados por página" usando CSS */
    .dataTables_wrapper .dataTables_length label {
        position: relative;
    }
    
    /* Ocultar texto após o select */
    .dataTables_wrapper .dataTables_length label select {
        margin-right: 0;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: center;
        margin-top: 1rem;
    }
    
    /* Paginação simplificada para mobile */
    .dataTables_wrapper .dataTables_paginate.mobile-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        padding: 8px 0;
        flex-direction: row; /* Garantir linha horizontal */
    }
    
    /* Garantir que todos os botões fiquem na mesma linha */
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button {
        flex-shrink: 0;
    }
    
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        margin: 0 2px;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        border: 1px solid #d1d5db;
        background-color: white;
        color: #374151;
        transition: all 0.2s;
        white-space: nowrap;
    }
    
    /* Garantir que Anterior e Próximo fiquem na mesma linha */
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button.previous,
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button.next {
        display: inline-flex !important;
        vertical-align: middle;
    }
    
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button:hover:not(.disabled):not(.current) {
        background-color: #f3f4f6;
        border-color: #9ca3af;
    }
    
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button.current {
        background-color: #7f13ec;
        color: white;
        border-color: #7f13ec;
    }
    
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    /* Ocultar botões Primeiro/Último no mobile */
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button.first,
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button.last {
        display: none !important;
    }
    
    /* Modo escuro para paginação mobile */
    .dark .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    .dark .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button:hover:not(.disabled):not(.current) {
        background-color: rgba(255, 255, 255, 0.1) !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
    }
    
    .dark .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button.current {
        background-color: #7f13ec !important;
        color: white !important;
        border-color: #7f13ec !important;
    }
    
    .dark .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button.disabled {
        background-color: rgba(255, 255, 255, 0.05) !important;
        color: rgba(255, 255, 255, 0.3) !important;
    }
    
    /* Ocultar colunas não essenciais em mobile */
    .dataTables_wrapper table th.none,
    .dataTables_wrapper table td.none {
        display: none !important;
    }
    
    /* Garantir que Nome e Ações sejam sempre visíveis */
    .dataTables_wrapper table th.all,
    .dataTables_wrapper table td.all {
        display: table-cell !important;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    .dataTables_wrapper .dtr-details {
        padding: 12px;
        background-color: #f9fafb;
        border-radius: 8px;
        margin-top: 8px;
    }
    
    .dark .dataTables_wrapper .dtr-details {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    /* Paginação ainda mais compacta */
    .dataTables_wrapper .dataTables_paginate.mobile-pagination .paginate_button {
        min-width: 32px;
        height: 32px;
        padding: 0 6px;
        font-size: 12px;
    }
    
    /* Ocultar completamente o texto "resultados por página" */
    .dataTables_wrapper .dataTables_length label {
        font-size: 12px;
    }
    
    .dataTables_wrapper .dataTables_length label span:contains('resultados'),
    .dataTables_wrapper .dataTables_length label span:contains('por'),
    .dataTables_wrapper .dataTables_length label span:contains('página') {
        display: none;
    }
}

/* Ocultar coluna de controle se existir */
.dataTables_wrapper table tbody td.control,
.dataTables_wrapper table thead th.control {
    display: none !important;
}

/* Desktop - mostrar todas as colunas */
@media (min-width: 769px) {
    .dataTables_wrapper table thead th,
    .dataTables_wrapper table tbody td {
        display: table-cell !important;
    }
}

/* Responsivo mobile - mostrar apenas Nome e Ações */
@media (max-width: 768px) {
    .dataTables_wrapper {
        overflow-x: visible;
    }
    
    .dataTables_wrapper table {
        width: 100% !important;
    }
    
    /* Ocultar todas as colunas por padrão */
    .dataTables_wrapper table thead th,
    .dataTables_wrapper table tbody td {
        display: none !important;
    }
    
    /* Mostrar apenas colunas com classe 'all' (Nome e Ações) */
    .dataTables_wrapper table thead th.all,
    .dataTables_wrapper table tbody td.all {
        display: table-cell !important;
    }
    
    /* Garantir que a segunda coluna (Nome) seja visível */
    .dataTables_wrapper table thead th:nth-child(2),
    .dataTables_wrapper table tbody td:nth-child(2) {
        display: table-cell !important;
    }
    
    /* Garantir que a última coluna (Ações) seja visível */
    .dataTables_wrapper table thead th:last-child,
    .dataTables_wrapper table tbody td:last-child {
        display: table-cell !important;
    }
}

/* Melhorar visualização dos detalhes responsivos */
.dataTables_wrapper .dtr-details {
    list-style: none;
    padding: 12px;
    margin: 8px 0 0 0;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.dark .dataTables_wrapper .dtr-details {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dataTables_wrapper .dtr-details > li {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.dataTables_wrapper .dtr-details > li:last-child {
    border-bottom: none;
}

.dark .dataTables_wrapper .dtr-details > li {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dataTables_wrapper .dtr-details .dtr-title {
    flex: 0 0 120px;
    margin-right: 12px;
    color: #374151;
}

.dark .dataTables_wrapper .dtr-details .dtr-title {
    color: rgba(255, 255, 255, 0.9);
}

.dataTables_wrapper .dtr-details .dtr-data {
    flex: 1 1 auto;
    word-break: break-word;
    color: #6b7280;
}

.dark .dataTables_wrapper .dtr-details .dtr-data {
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   RESPONSIVIDADE - TELA DE EVENTOS
   ======================================== */

/* Container de tabs com scroll horizontal */
.evento-tabs-container {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.evento-tabs-container::-webkit-scrollbar {
    height: 6px;
}

.evento-tabs-container::-webkit-scrollbar-track {
    background: transparent;
}

.evento-tabs-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.evento-tabs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.dark .evento-tabs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.dark .evento-tabs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Garantir que botões de tab não quebrem e mantenham tamanho mínimo */
.evento-tab-button-gestao {
    flex-shrink: 0;
    min-width: fit-content;
}

/* Ajustes para cabeçalho de eventos em mobile */
@media (max-width: 640px) {
    /* Garantir que o container de eventos use toda a largura */
    #eventos-gestao-view {
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Ajustar padding do card principal em mobile */
    #eventos-gestao-view .bg-white {
        padding: 1rem;
    }
    
    /* Garantir que conteúdo das tabs não tenha overflow horizontal */
    .evento-tab-content-gestao {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Ajustar grid de informações em mobile */
    #eventos-gestao-view .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

/* Ajustes para tablets */
@media (min-width: 641px) and (max-width: 1023px) {
    #eventos-gestao-view .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Cabeçalhos da grade de orçamento: cursor de ajuda ao pairar (tooltip nativo title) */
#form-criar-orcamento thead th.cursor-help {
    cursor: help;
}

/* ========================================
   CABEÇALHO COMPACTO DO CRIAR/EDITAR ORÇAMENTO
   ======================================== */
#module-content #criar-orcamento-header .orc-header-status-dot {
    background: #9ca3af;
}
/* Status de negócio do orçamento */
#module-content #criar-orcamento-header .orc-header-status-dot.pendente { background: #f59e0b; }
#module-content #criar-orcamento-header .orc-header-status-dot.aprovado { background: #10b981; }
#module-content #criar-orcamento-header .orc-header-status-dot.reprovado { background: #ef4444; }
#module-content #criar-orcamento-header .orc-header-status-dot.cancelado { background: #6b7280; }

/* Status legados do evento (mantidos por compatibilidade) */
#module-content #criar-orcamento-header .orc-header-status-dot.aberto { background: #9ca3af; }
#module-content #criar-orcamento-header .orc-header-status-dot.equipe_definida { background: #3b82f6; }
#module-content #criar-orcamento-header .orc-header-status-dot.em_orcamento { background: #f59e0b; }
#module-content #criar-orcamento-header .orc-header-status-dot.em_aprovacao { background: #f97316; }
#module-content #criar-orcamento-header .orc-header-status-dot.em_execucao { background: #8b5cf6; }
#module-content #criar-orcamento-header .orc-header-status-dot.finalizado { background: #10b981; }

/* Select de status no cabeçalho (inline, aparência discreta) */
#module-content #criar-orcamento-header .orc-header-status-select {
    padding: 0;
    margin: 0;
    min-height: 0;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    box-shadow: none;
}
#module-content #criar-orcamento-header .orc-header-status-select:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
#module-content #criar-orcamento-header .orc-header-status-select:focus {
    outline: none;
    box-shadow: none;
}

/* ========================================
   ESTILOS ESPECÍFICOS PARA CAMPOS DE SERVIÇOS NO ORÇAMENTO
   ======================================== */

/* Uma única régua para toda a linha: inputs e select com .form-input.text-sm no tbody da grade.
   Antes só algumas classes .servico-* estavam listadas; taxas (servico-taxa-*) herdavam o .form-input
   global (14px / padding maior) e ficavam mais altos que Saving e demais colunas.
   Duplo #module-content + #form-criar-orcamento para vencer #module-content .wrap .form-input do editar-evento.css
   Inclui #orcamento-servicos-accordion-root: visão blocos move os mesmos inputs para fora do <tr>. */
#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item input.form-input.text-sm,
#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item select.form-input.text-sm,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item input.form-input.text-sm,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item select.form-input.text-sm {
    box-sizing: border-box !important;
    min-height: 2.25rem !important;
    height: 2.25rem !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    line-height: 1.25rem !important;
    margin-bottom: 0 !important;
}

/* Select: reserva à direita para a seta do .form-input (style.css global) */
#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item select.form-input.text-sm,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item select.form-input.text-sm {
    padding: 6px 2rem 6px 8px !important;
}

/*
 * Larguras ideais por tipo — grade e accordion do orçamento (mesmas classes nos inputs).
 * box-sizing já vem do bloco acima nos .form-input.text-sm da linha.
 */
#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item input.orc-inp-monetario,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item input.orc-inp-monetario {
    width: 100%;
    min-width: 140px;
    max-width: 160px;
}

#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item input.orc-inp-pct,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item input.orc-inp-pct {
    width: 100%;
    min-width: 100px;
    max-width: 120px;
}

#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item input.orc-inp-numero,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item input.orc-inp-numero {
    width: 100%;
    min-width: 80px;
    max-width: 100px;
}

#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item input.orc-inp-data,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item input.orc-inp-data {
    width: 100%;
    min-width: 140px;
    max-width: 140px;
}

#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item input.orc-inp-hora,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item input.orc-inp-hora {
    width: 100%;
    min-width: 100px;
    max-width: 100px;
}

#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item select.orc-inp-select-largo,
#module-content #form-criar-orcamento #orcamento-servicos-accordion-root .servico-orcamento-item select.orc-inp-select-largo {
    width: 100%;
    min-width: 180px;
    max-width: 220px;
}

/* Texto médio: coluna nome + categoria na grade (accordion usa o nome só no summary) */
#module-content #form-criar-orcamento #orcamento-servicos-lista tr.servico-orcamento-item td.orc-td-servico-nome {
    min-width: 240px;
    max-width: 320px;
}

/* Editar evento — checkbox “serviços do template” ao lado do select */
.briefing-template-checkbox {
    accent-color: var(--primary-color, #3b82f6);
}

/* Ação de IA abaixo do textarea de briefing */
.field-briefing-edicao .briefing-ia-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/**
 * Botões que disparam o Agente IA (melhorar texto, identificar serviços, classificação, etc.).
 * Padrão único: gradiente teal/ciano — distinto do .btn-primary (roxo/azul de ação principal).
 * Sempre use a classe .btn-ia (ou alias .btn-briefing-ia) + utilitários Tailwind (py-*, px-*, text-sm).
 */
.btn-ia,
.btn-briefing-ia {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 600;
    color: #fff !important;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 45%, #14b8a6 100%);
    border: 1px solid rgba(13, 148, 136, 0.65);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow:
        0 1px 2px rgba(15, 118, 110, 0.25),
        0 2px 10px rgba(13, 148, 136, 0.22);
}

.btn-ia:hover:not(:disabled),
.btn-briefing-ia:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow:
        0 2px 8px rgba(15, 118, 110, 0.3),
        0 6px 20px rgba(20, 184, 166, 0.28);
    transform: translateY(-1px);
}

.btn-ia:active:not(:disabled),
.btn-briefing-ia:active:not(:disabled) {
    transform: translateY(0);
    filter: brightness(0.95);
}

.btn-ia:focus-visible,
.btn-briefing-ia:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(45, 212, 191, 0.45),
        0 4px 14px rgba(13, 148, 136, 0.35);
}

.btn-ia:disabled,
.btn-briefing-ia:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.12);
    box-shadow: none;
}

.btn-briefing-ia-icon,
.btn-ia .material-symbols-outlined {
    font-size: 1.125rem;
    line-height: 1;
}

html.dark .btn-ia,
.dark .btn-ia,
html.dark .btn-briefing-ia,
.dark .btn-briefing-ia,
body.dark-mode .btn-ia,
body.dark-mode .btn-briefing-ia {
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 40%, #0d9488 100%);
    border-color: rgba(94, 234, 212, 0.5);
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(45, 212, 191, 0.35);
}

html.dark .btn-ia:hover:not(:disabled),
.dark .btn-ia:hover:not(:disabled),
html.dark .btn-briefing-ia:hover:not(:disabled),
.dark .btn-briefing-ia:hover:not(:disabled),
body.dark-mode .btn-ia:hover:not(:disabled),
body.dark-mode .btn-briefing-ia:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow:
        0 4px 20px rgba(20, 184, 166, 0.4),
        0 0 0 1px rgba(153, 246, 228, 0.35);
}

/* ===========================================
   Validador de Cálculo (modal timeline)
   Usado em criar-orcamento (linha e Resumo)
=========================================== */
.orc-valid-overlay {
    position: fixed; inset: 0; background: rgba(17, 24, 39, 0.55);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 9998; padding: 32px 16px; overflow-y: auto;
}
.orc-valid-overlay.is-open { display: flex; }
.orc-valid-modal {
    background: #fff; color: #141118; width: 100%; max-width: 880px;
    border-radius: 14px; box-shadow: 0 25px 50px rgba(0,0,0,.25);
    overflow: hidden; display: flex; flex-direction: column;
    max-height: calc(100vh - 64px);
}
.dark .orc-valid-modal { background: #1f2937; color: #f3f4f6; }
.orc-valid-head {
    padding: 14px 18px; border-bottom: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.dark .orc-valid-head { border-color: rgba(255,255,255,.1); }
.orc-valid-head h3 { font-size: 15px; font-weight: 600; margin: 0; }
.orc-valid-head .orc-valid-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.dark .orc-valid-head .orc-valid-sub { color: #9ca3af; }
.orc-valid-close {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; color: #6b7280;
    transition: background .15s ease;
}
.orc-valid-close:hover { background: #f3f4f6; color: #111827; }
.dark .orc-valid-close { background: transparent; border-color: rgba(255,255,255,.15); color: #d1d5db; }
.dark .orc-valid-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.orc-valid-body { padding: 16px 18px; overflow-y: auto; }
.orc-valid-foot {
    padding: 10px 18px; border-top: 1px solid #e5e7eb; font-size: 11px; color: #6b7280;
}
.dark .orc-valid-foot { border-color: rgba(255,255,255,.1); color: #9ca3af; }

/* Agrupamento (Fornecedor / Agência / Cliente) */
.orc-valid-group { margin-bottom: 18px; }
.orc-valid-group:last-child { margin-bottom: 0; }
.orc-valid-group-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: #6b7280; margin: 0 0 8px 0;
}
.dark .orc-valid-group-title { color: #9ca3af; }
.orc-valid-group-title .dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.orc-valid-group.forn .dot { background: #f59e0b; }
.orc-valid-group.ag   .dot { background: #8b5cf6; }
.orc-valid-group.cli  .dot { background: #0ea5e9; }
.orc-valid-group.res  .dot { background: #10b981; }

/* Timeline */
.orc-valid-timeline {
    position: relative; padding: 4px 0 4px 22px; margin: 0;
    list-style: none;
}
.orc-valid-timeline::before {
    content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
    width: 2px; background: #e5e7eb;
}
.dark .orc-valid-timeline::before { background: rgba(255,255,255,.12); }
.orc-valid-step {
    position: relative; padding: 8px 10px 8px 0;
}
.orc-valid-step::before {
    content: ''; position: absolute; left: -19px; top: 13px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2px solid #9ca3af;
}
.dark .orc-valid-step::before { background: #1f2937; }
.orc-valid-group.forn .orc-valid-step::before { border-color: #f59e0b; }
.orc-valid-group.ag   .orc-valid-step::before { border-color: #8b5cf6; }
.orc-valid-group.cli  .orc-valid-step::before { border-color: #0ea5e9; }
.orc-valid-group.res  .orc-valid-step::before { border-color: #10b981; }
.orc-valid-step.is-total::before { background: #10b981; border-color: #10b981; }

.orc-valid-step-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.orc-valid-step-title {
    font-size: 13px; font-weight: 600; color: #141118;
}
.dark .orc-valid-step-title { color: #f3f4f6; }
.orc-valid-step-code {
    display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .04em;
    padding: 1px 6px; border-radius: 4px; background: #f3f4f6; color: #4b5563;
    margin-left: 6px; text-transform: uppercase;
}
.dark .orc-valid-step-code { background: rgba(255,255,255,.1); color: #d1d5db; }
.orc-valid-step-formula {
    font-size: 11px; color: #6b7280; margin-top: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.dark .orc-valid-step-formula { color: #9ca3af; }
.orc-valid-step-note {
    font-size: 11px; color: #6b7280; margin-top: 3px; font-style: italic;
}
.dark .orc-valid-step-note { color: #9ca3af; }
.orc-valid-step-value {
    font-size: 13px; font-weight: 700; white-space: nowrap; color: #141118;
}
.dark .orc-valid-step-value { color: #f3f4f6; }
.orc-valid-step-value.pos { color: #059669; }
.orc-valid-step-value.neg { color: #dc2626; }
.dark .orc-valid-step-value.pos { color: #34d399; }
.dark .orc-valid-step-value.neg { color: #f87171; }

.orc-valid-step.is-total {
    background: #ecfdf5; border-radius: 8px; padding-left: 10px; margin-top: 4px;
}
.dark .orc-valid-step.is-total { background: rgba(16,185,129,.1); }
.orc-valid-step.is-sub {
    background: #f9fafb; border-radius: 6px; padding-left: 10px;
}
.dark .orc-valid-step.is-sub { background: rgba(255,255,255,.04); }

/* Linha separadora entre "serviços" no Resumo */
.orc-valid-servico-sep {
    height: 1px; background: #e5e7eb; margin: 14px 0; border: 0;
}
.dark .orc-valid-servico-sep { background: rgba(255,255,255,.1); }
.orc-valid-servico-head {
    font-size: 13px; font-weight: 700; color: #141118;
    margin: 0 0 8px 0; display: flex; align-items: center; gap: 8px;
}
.dark .orc-valid-servico-head { color: #f3f4f6; }
.orc-valid-servico-head .idx {
    background: #e5e7eb; color: #4b5563; border-radius: 50%; width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.dark .orc-valid-servico-head .idx { background: rgba(255,255,255,.1); color: #d1d5db; }

/* Botão "Validar cálculo" */
.btn-validar-calculo-orc {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
    transition: all .15s ease; cursor: pointer;
}
.btn-validar-calculo-orc:hover { background: #e0e7ff; color: #3730a3; }
.dark .btn-validar-calculo-orc {
    background: rgba(99,102,241,.15); color: #a5b4fc; border-color: rgba(99,102,241,.35);
}
.dark .btn-validar-calculo-orc:hover { background: rgba(99,102,241,.25); color: #c7d2fe; }
.btn-validar-calculo-orc .material-symbols-outlined { font-size: 18px; }

/* Botões de ação dentro do accordion expandido (ícone + label) ---------- */
.btn-acao-accordion-expandida {
    width: auto !important;
    min-width: 0;
    height: 32px;
}
.btn-acao-accordion-expandida .btn-acao-label {
    line-height: 1;
}

/* Toggle Percentual <-> Moeda (R$) ----------------------------------- */
.orc-pct-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
}
.orc-pct-toggle-wrap > .orc-pct-toggle-input {
    flex: 1 1 auto;
    min-width: 0;
}
.orc-pct-toggle-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-width: 26px;
    padding: 0 6px;
    border-radius: 6px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.orc-pct-toggle-btn:hover { background: #e0e7ff; color: #3730a3; }
.orc-pct-toggle-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,.45);
}
.dark .orc-pct-toggle-btn {
    background: rgba(99,102,241,.15);
    color: #a5b4fc;
    border-color: rgba(99,102,241,.35);
}
.dark .orc-pct-toggle-btn:hover {
    background: rgba(99,102,241,.25);
    color: #c7d2fe;
}
/* Estado: input em modo MOEDA — borda em destaque para sinalizar ao usuário */
.orc-pct-toggle-input.is-moeda {
    border-color: #6366f1 !important;
    background-color: #eef2ff;
    color: #312e81;
}
.dark .orc-pct-toggle-input.is-moeda {
    background-color: rgba(99,102,241,.15);
    color: #c7d2fe;
}

/* ============================================================
   Grade de Serviços × Fornecedores (modal comparativo)
   Módulo independente: js/grade-servicos.js + modules/grade-servicos.php
============================================================ */
.grade-overlay {
    position: fixed; inset: 0; background: rgba(17, 24, 39, 0.55);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 9998; padding: 24px 12px; overflow-y: auto;
}
.grade-overlay.is-open { display: flex; }
.grade-modal {
    background: #fff; color: #141118; width: 100%; max-width: 1280px;
    border-radius: 14px; box-shadow: 0 25px 50px rgba(0,0,0,.25);
    overflow: hidden; display: flex; flex-direction: column;
    max-height: calc(100vh - 48px);
}
.dark .grade-modal { background: #1f2937; color: #f3f4f6; }
.grade-head {
    padding: 14px 18px; border-bottom: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex: 0 0 auto;
}
.dark .grade-head { border-color: rgba(255,255,255,.1); }
.grade-head h3 { font-size: 16px; font-weight: 600; margin: 0; }
.grade-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.dark .grade-sub { color: #9ca3af; }
.grade-close {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; color: #6b7280;
    transition: background .15s ease;
}
.grade-close:hover { background: #f3f4f6; color: #111827; }
.dark .grade-close { background: transparent; border-color: rgba(255,255,255,.15); color: #d1d5db; }
.dark .grade-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.grade-body { padding: 16px 18px; overflow: auto; flex: 1 1 auto; }
.grade-foot {
    padding: 10px 18px; border-top: 1px solid #e5e7eb; font-size: 11px; color: #6b7280;
    flex: 0 0 auto;
}
.dark .grade-foot { border-color: rgba(255,255,255,.1); color: #9ca3af; }

/* Estados de loading / vazio / erro ----------------------------------- */
.grade-loading {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 40px 16px; color: #6b7280; font-size: 13px;
}
.dark .grade-loading { color: #9ca3af; }
.grade-spin { animation: gradeSpin 1s linear infinite; font-size: 22px; }
@keyframes gradeSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.grade-empty {
    text-align: center; padding: 40px 16px; color: #6b7280;
}
.grade-empty p { margin: 6px 0; font-size: 14px; }
.grade-empty .grade-empty-sub { font-size: 12px; color: #9ca3af; }
.dark .grade-empty { color: #9ca3af; }
.dark .grade-empty .grade-empty-sub { color: #6b7280; }
.grade-error { color: #b91c1c; }
.dark .grade-error { color: #f87171; }

/* Tabela --------------------------------------------------------------- */
.grade-tabela-wrap {
    overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 10px;
}
.dark .grade-tabela-wrap { border-color: rgba(255,255,255,.1); }
.grade-tabela {
    width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px;
    min-width: 720px;
}
.grade-tabela th, .grade-tabela td {
    border-bottom: 1px solid #e5e7eb; vertical-align: top;
    padding: 0;
}
.dark .grade-tabela th, .dark .grade-tabela td { border-color: rgba(255,255,255,.08); }
.grade-tabela tbody tr:last-child td { border-bottom: 1px solid #e5e7eb; }
.dark .grade-tabela tbody tr:last-child td { border-bottom-color: rgba(255,255,255,.12); }

.grade-th-servico, .grade-th-fornecedor, .grade-th-total {
    background: #f9fafb; font-weight: 600; font-size: 12px; color: #374151;
    text-align: left; padding: 10px 12px;
    position: sticky; top: 0; z-index: 2;
    border-bottom: 1px solid #e5e7eb;
}
.dark .grade-th-servico, .dark .grade-th-fornecedor, .dark .grade-th-total {
    background: rgba(255,255,255,.04); color: #d1d5db; border-color: rgba(255,255,255,.1);
}
.grade-th-servico { min-width: 180px; }
.grade-th-fornecedor { min-width: 180px; }
.grade-th-fornecedor-nome {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    color: #111827; font-weight: 600;
}
.dark .grade-th-fornecedor-nome { color: #f3f4f6; }
.grade-th-orc-code {
    display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px;
    background: #e0e7ff; color: #3730a3; font-weight: 700; letter-spacing: .03em;
}
.dark .grade-th-orc-code { background: rgba(99,102,241,.2); color: #c7d2fe; }
.grade-th-fornecedor-sub { font-size: 11px; color: #6b7280; margin-top: 2px; font-weight: 500; }
.dark .grade-th-fornecedor-sub { color: #9ca3af; }
.grade-th-total { background: #eef2ff; color: #3730a3; min-width: 180px; }
.dark .grade-th-total { background: rgba(99,102,241,.12); color: #c7d2fe; }

/* Coluna serviço (1ª) — sticky para scroll horizontal */
.grade-td-servico {
    background: #fff; padding: 10px 12px;
    position: sticky; left: 0; z-index: 1;
    border-right: 1px solid #e5e7eb;
    min-width: 180px;
}
.dark .grade-td-servico { background: #1f2937; border-color: rgba(255,255,255,.1); }
.grade-td-servico-nome { font-weight: 600; color: #111827; font-size: 13px; }
.dark .grade-td-servico-nome { color: #f3f4f6; }
.grade-td-servico-cat { font-size: 11px; color: #6b7280; margin-top: 2px; }
.dark .grade-td-servico-cat { color: #9ca3af; }
.grade-th-servico { position: sticky; left: 0; z-index: 3; }

/* Células da matriz ---------------------------------------------------- */
.grade-td-cell { padding: 6px; }
.grade-td-cell-total { background: #fafbff; }
.dark .grade-td-cell-total { background: rgba(99,102,241,.06); }

.grade-cell {
    border: 1px solid transparent; border-radius: 8px; padding: 8px 10px;
    background: #f9fafb; min-width: 160px;
    display: flex; flex-direction: column; gap: 2px;
}
.dark .grade-cell { background: rgba(255,255,255,.04); }
.grade-cell-empty {
    display: flex; align-items: center; justify-content: center;
    color: #9ca3af; font-size: 18px; font-weight: 700;
    min-height: 64px;
}
.grade-line {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 11px;
}
.grade-line-label { color: #6b7280; font-weight: 500; }
.dark .grade-line-label { color: #9ca3af; }
.grade-line-value { font-weight: 600; color: #111827; font-variant-numeric: tabular-nums; }
.dark .grade-line-value { color: #f3f4f6; }
.grade-val-cli { color: #0369a1; }
.dark .grade-val-cli { color: #38bdf8; }
.grade-val-forn { color: #b45309; }
.dark .grade-val-forn { color: #fbbf24; }
.grade-line-rent {
    margin-top: 2px; padding-top: 4px; border-top: 1px dashed #e5e7eb;
    font-size: 12px;
}
.dark .grade-line-rent { border-top-color: rgba(255,255,255,.12); }
.grade-line-rent .grade-line-value { font-weight: 700; }
.grade-line-rent .grade-line-value.is-pos { color: #047857; }
.grade-line-rent .grade-line-value.is-neg { color: #b91c1c; }
.dark .grade-line-rent .grade-line-value.is-pos { color: #34d399; }
.dark .grade-line-rent .grade-line-value.is-neg { color: #f87171; }
.grade-rent-pct { font-size: 10px; opacity: .8; font-weight: 500; }

/* Vencedor por linha (rentabilidade R$ máxima) */
.grade-cell-best {
    background: #d1fae5;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16,185,129,.15);
    position: relative;
}
.grade-cell-best::after {
    content: '★'; position: absolute; top: 4px; right: 6px;
    font-size: 10px; color: #047857; line-height: 1;
}
.dark .grade-cell-best {
    background: rgba(16,185,129,.18); border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52,211,153,.15);
}
.dark .grade-cell-best::after { color: #34d399; }
.grade-cell-best .grade-line-label { color: #065f46; }
.dark .grade-cell-best .grade-line-label { color: #6ee7b7; }
.grade-cell-best .grade-line-value { color: #065f46; }
.dark .grade-cell-best .grade-line-value { color: #d1fae5; }
.grade-cell-best .grade-val-cli { color: #0c4a6e; }
.grade-cell-best .grade-val-forn { color: #92400e; }

/* Total (Σ por serviço / Σ por fornecedor) */
.grade-cell-total {
    background: #eef2ff; border-color: #c7d2fe;
}
.dark .grade-cell-total {
    background: rgba(99,102,241,.15); border-color: rgba(99,102,241,.35);
}

/* Rodapé */
.grade-tabela tfoot td {
    background: #f5f3ff; padding: 6px;
    border-top: 2px solid #c7d2fe;
    border-bottom: 0;
}
.dark .grade-tabela tfoot td {
    background: rgba(124,58,237,.12); border-top-color: rgba(124,58,237,.4);
}
.grade-tabela tfoot .grade-tf-label {
    background: #f5f3ff; font-weight: 700; color: #4338ca;
    padding: 10px 12px; font-size: 12px;
    position: sticky; left: 0; z-index: 1; text-transform: uppercase; letter-spacing: .04em;
}
.dark .grade-tabela tfoot .grade-tf-label { background: rgba(124,58,237,.2); color: #c4b5fd; }

/* Legenda */
.grade-legenda {
    margin-top: 12px; display: flex; flex-wrap: wrap; gap: 16px;
    font-size: 11px; color: #6b7280; align-items: center;
}
.dark .grade-legenda { color: #9ca3af; }
.grade-legenda-item { display: inline-flex; align-items: center; gap: 6px; }
.grade-legenda-swatch {
    display: inline-block; width: 18px; height: 14px; border-radius: 4px;
    border: 1px solid transparent;
}
.grade-legenda-swatch.grade-cell-best {
    background: #d1fae5; border-color: #10b981; box-shadow: none; padding: 0;
}
.grade-legenda-swatch.grade-cell-best::after { display: none; }

/* Botão de abrir a Grade */
.btn-grade-servicos {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 32px; padding: 0 12px;
    border-radius: 8px;
    background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
    font-size: 12px; font-weight: 600;
    transition: all .15s ease; cursor: pointer; white-space: nowrap;
}
.btn-grade-servicos:hover { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.btn-grade-servicos .material-symbols-outlined { font-size: 18px; }
.dark .btn-grade-servicos {
    background: rgba(16,185,129,.15); color: #6ee7b7; border-color: rgba(16,185,129,.35);
}
.dark .btn-grade-servicos:hover { background: rgba(16,185,129,.25); color: #a7f3d0; }

/* ============================================================
   Simulador do CLIENTE — matriz interativa de seleção
   Reaproveita .grade-tabela / .grade-cell, com células clicáveis.
   ============================================================ */
.cliente-grade-simulador .grade-td-cell.sim-cell {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.cliente-grade-simulador .grade-td-cell.sim-cell:hover .sim-cell-inner {
    background: #eff6ff;
    border-color: #93c5fd;
}
.dark .cliente-grade-simulador .grade-td-cell.sim-cell:hover .sim-cell-inner {
    background: rgba(59,130,246,.18); border-color: rgba(96,165,250,.4);
}
.cliente-grade-simulador .grade-td-cell.sim-cell:focus-visible {
    outline: 2px solid #2563eb; outline-offset: 2px;
}
.cliente-grade-simulador .grade-td-cell.sim-cell-selected .sim-cell-inner {
    background: #dbeafe;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,.18);
    position: relative;
}
.cliente-grade-simulador .grade-td-cell.sim-cell-selected .sim-cell-inner::after {
    content: '✓';
    position: absolute; top: 4px; right: 6px;
    font-size: 12px; font-weight: 700; line-height: 1; color: #1d4ed8;
}
.dark .cliente-grade-simulador .grade-td-cell.sim-cell-selected .sim-cell-inner {
    background: rgba(59,130,246,.25); border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96,165,250,.25);
}
.dark .cliente-grade-simulador .grade-td-cell.sim-cell-selected .sim-cell-inner::after { color: #bfdbfe; }
.cliente-grade-simulador .sim-cell-summary {
    background: #f1f5f9; border-color: #cbd5e1; min-width: 160px;
}
.dark .cliente-grade-simulador .sim-cell-summary {
    background: rgba(148,163,184,.12); border-color: rgba(148,163,184,.3);
}

/* ---- Simulador: cabeçalhos centralizados + mais respiro nas bordas ---- */
.cliente-grade-simulador th.grade-th-servico,
.cliente-grade-simulador th.grade-th-fornecedor,
.cliente-grade-simulador th.grade-th-total {
    text-align: center;
    padding: 14px 16px;
}
.cliente-grade-simulador .grade-th-fornecedor-nome {
    justify-content: center;
}
.cliente-grade-simulador .grade-td-servico {
    padding: 14px 16px;
}
.cliente-grade-simulador .grade-td-cell {
    padding: 8px 10px;
}
.cliente-grade-simulador .grade-cell {
    padding: 10px 12px;
}
.cliente-grade-simulador .grade-line-label,
.cliente-grade-simulador .grade-line-value {
    padding: 0 2px;
}

/* ================================================================
 * Grade de Aprovação do Cliente (Serviços × Propostas)
 * ================================================================ */

.cli-prop-filtro-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px;
    border: 1px solid #d1d5db; background: #fff;
    color: #374151; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all .15s ease;
}
.cli-prop-filtro-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.cli-prop-filtro-btn-active {
    background: #1d4ed8; border-color: #1d4ed8; color: #fff;
}
.cli-prop-filtro-btn-active:hover { background: #1e40af; border-color: #1e40af; }
.dark .cli-prop-filtro-btn { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.15); color: #d1d5db; }
.dark .cli-prop-filtro-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
.dark .cli-prop-filtro-btn-active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* Grade propostas cliente: rolagem horizontal + colunas com largura mínima (evita espremimento) */
.cli-prop-grade-wrap.grade-tabela-wrap {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
.cli-prop-grade.grade-tabela {
    width: max-content;
    min-width: min(100%, 720px);
    border-collapse: separate;
    /* Espaço entre colunas para os botões do cabeçalho não “colarem” nos cards vizinhos */
    border-spacing: 14px 0;
}
.cli-prop-grade th.cli-prop-th-coluna,
.cli-prop-grade tbody tr td.grade-td-cell:not(:first-child),
.cli-prop-grade tfoot tr td.grade-td-cell:not(:first-child) {
    min-width: 360px;
    width: 360px;
    max-width: 360px;
    box-sizing: border-box;
    vertical-align: top;
}
.cli-prop-grade th.cli-prop-th-coluna {
    padding: 10px 12px;
    background: #f9fafb;
    border-bottom: 3px solid transparent;
}
.dark .cli-prop-grade th.cli-prop-th-coluna { background: rgba(255,255,255,.04); }
.cli-prop-grade thead th.grade-th-servico,
.cli-prop-grade tbody td.grade-td-servico,
.cli-prop-grade tfoot .grade-tf-label {
    min-width: 200px;
    width: 200px;
    max-width: 220px;
    box-sizing: border-box;
}

/* Aproxima a grade de propostas do visual da grade de simulação */
.cli-prop-grade th.grade-th-servico,
.cli-prop-grade .cli-prop-th-coluna {
    text-align: center;
    padding: 14px 16px;
}
.cli-prop-grade .grade-td-servico {
    padding: 14px 16px;
}
.cli-prop-grade .grade-td-cell {
    padding: 8px 10px;
}
.cli-prop-grade .grade-cell {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
}
.cli-prop-grade .cli-prop-cell-saving-pos,
.cliente-grade-simulador .cli-prop-cell-saving-pos {
    color: #047857;
    font-weight: 600;
}
.cli-prop-grade .cli-prop-cell-saving-neg,
.cliente-grade-simulador .cli-prop-cell-saving-neg {
    color: #b91c1c;
    font-weight: 600;
}
.dark .cli-prop-grade .cli-prop-cell-saving-pos,
.dark .cliente-grade-simulador .cli-prop-cell-saving-pos {
    color: #6ee7b7;
}
.dark .cli-prop-grade .cli-prop-cell-saving-neg,
.dark .cliente-grade-simulador .cli-prop-cell-saving-neg {
    color: #fca5a5;
}

.cli-prop-grade .grade-line-label,
.cli-prop-grade .grade-line-value {
    padding: 0 2px;
}

.cli-prop-grade .cli-prop-th-status-pendente { border-bottom-color: #f59e0b; }
.cli-prop-grade .cli-prop-th-status-aprovada { border-bottom-color: #10b981; }
.cli-prop-grade .cli-prop-th-status-reprovada { border-bottom-color: #ef4444; }

.cli-prop-th-linha {
    display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
    justify-content: center;
}
.cli-prop-th-spacer { display: inline-block; width: 14px; }
.cli-prop-th-codigo {
    font-size: 13px; font-weight: 700; color: #111827;
    flex: 1; min-width: 0; text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dark .cli-prop-th-codigo { color: #f9fafb; }

.cli-prop-th-meta {
    display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px;
    justify-content: center;
}

.cli-prop-th-totais {
    display: flex; flex-direction: column; gap: 2px;
    margin-bottom: 8px; padding: 6px 8px;
    background: rgba(59,130,246,.06); border-radius: 6px;
    border: 1px solid rgba(59,130,246,.15);
    align-items: center;
}
.dark .cli-prop-th-totais { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.25); }
.cli-prop-th-total {
    font-size: 14px; font-weight: 700; color: #1e3a8a;
}
.dark .cli-prop-th-total { color: #93c5fd; }
.cli-prop-th-validade { font-size: 11px; color: #6b7280; }
.dark .cli-prop-th-validade { color: #9ca3af; }
.cli-prop-th-validade-vazio { font-style: italic; color: #9ca3af; }

/* Modal detalhe da proposta (cliente) — cabeçalho alinhado à visão consultor */
.cli-prop-modal-detalhe {
    max-width: min(1536px, calc(100vw - 1.5rem));
}

.cli-prop-detalhe-table {
    width: 100%;
    min-width: 1220px;
    border-collapse: collapse;
    font-size: 12px;
}
.cli-prop-detalhe-table .cli-prop-detalhe-saving {
    font-weight: 600;
}
.cli-prop-detalhe-table .cli-prop-detalhe-saving-pos {
    color: #047857;
}
.cli-prop-detalhe-table .cli-prop-detalhe-saving-neg {
    color: #b91c1c;
}
.dark .cli-prop-detalhe-table .cli-prop-detalhe-saving-pos {
    color: #6ee7b7;
}
.dark .cli-prop-detalhe-table .cli-prop-detalhe-saving-neg {
    color: #fca5a5;
}
.cli-prop-detalhe-table thead.cli-prop-detalhe-thead th {
    background: #f8f9fa;
    color: #111827;
    font-weight: 700;
    text-align: center;
    padding: 10px 6px;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}
.cli-prop-detalhe-table tbody td {
    padding: 8px 6px;
    border: 1px solid #e5e7eb;
    vertical-align: top;
}
.cli-prop-detalhe-table .cli-prop-detalhe-col-serv { text-align: left; white-space: normal; min-width: 120px; }
.cli-prop-detalhe-table .cli-prop-detalhe-col-forn { text-align: left; white-space: normal; min-width: 100px; max-width: 180px; }
.cli-prop-detalhe-table .cli-prop-detalhe-col-per { text-align: center; white-space: normal; max-width: 140px; }
.cli-prop-detalhe-table .cli-prop-detalhe-num { text-align: right; font-variant-numeric: tabular-nums; }
.dark .cli-prop-detalhe-table thead.cli-prop-detalhe-thead th {
    background: rgba(255,255,255,.08);
    color: #f9fafb;
    border-color: rgba(255,255,255,.12);
}
.dark .cli-prop-detalhe-table tbody td {
    border-color: rgba(255,255,255,.1);
}

.cli-prop-th-acoes {
    display: flex; flex-wrap: wrap; gap: 4px;
    justify-content: center;
    align-items: center;
}
/* Botões de ação do cabeçalho: uma linha — sem rolagem interna (só a rolagem do .cli-prop-grade-wrap) */
.cli-prop-grade .cli-prop-th-acoes {
    flex-wrap: nowrap;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    overflow: visible;
}

.cli-prop-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 9px; border-radius: 8px;
    font-size: 12px; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; transition: all .15s ease;
    white-space: nowrap;
    min-width: 98px;
    justify-content: center;
}
.cli-prop-btn .material-symbols-outlined { font-size: 16px; }
.cli-prop-btn-label { line-height: 1; }

/* Garante equilíbrio visual entre os botões da coluna */
.cli-prop-btn-ver { min-width: 102px; }
.cli-prop-btn-aprovar,
.cli-prop-btn-reprovar { min-width: 106px; }

/* Na grade de propostas, botões compactos para caber Detalhes + Aprovar + Reprovar (+ Descartar) em uma linha */
.cli-prop-grade .cli-prop-btn {
    min-width: 0;
    flex: 0 0 auto;
    padding: 5px 7px;
    font-size: 11px;
    gap: 3px;
}
.cli-prop-grade .cli-prop-btn-ver,
.cli-prop-grade .cli-prop-btn-aprovar,
.cli-prop-grade .cli-prop-btn-reprovar {
    min-width: 0;
}
.cli-prop-grade .cli-prop-btn .material-symbols-outlined {
    font-size: 15px;
}

.cli-prop-btn-aprovar { background: #10b981; color: #fff; border-color: #059669; }
.cli-prop-btn-aprovar:hover { background: #059669; }

.cli-prop-btn-reprovar { background: #ef4444; color: #fff; border-color: #dc2626; }
.cli-prop-btn-reprovar:hover { background: #dc2626; }

.cli-prop-btn-ghost { background: #fff; color: #374151; border-color: #d1d5db; }
.cli-prop-btn-ghost:hover { background: #f3f4f6; border-color: #9ca3af; }
.dark .cli-prop-btn-ghost { background: rgba(255,255,255,.05); color: #d1d5db; border-color: rgba(255,255,255,.15); }
.dark .cli-prop-btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); }

.cli-prop-btn-ver { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.cli-prop-btn-ver:hover { background: #dbeafe; border-color: #93c5fd; }
.dark .cli-prop-btn-ver { background: rgba(59,130,246,.15); color: #93c5fd; border-color: rgba(59,130,246,.3); }
.dark .cli-prop-btn-ver:hover { background: rgba(59,130,246,.25); }

.cli-prop-badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; line-height: 1.4;
}
.cli-prop-badge-pendente { background: #fef3c7; color: #78350f; }
.dark .cli-prop-badge-pendente { background: rgba(245,158,11,.2); color: #fcd34d; }
.cli-prop-badge-aprovada { background: #d1fae5; color: #065f46; }
.dark .cli-prop-badge-aprovada { background: rgba(16,185,129,.2); color: #6ee7b7; }
.cli-prop-badge-reprovada { background: #fee2e2; color: #991b1b; }
.dark .cli-prop-badge-reprovada { background: rgba(239,68,68,.2); color: #fca5a5; }
.cli-prop-badge-origem-ag { background: #f3f4f6; color: #374151; }
.dark .cli-prop-badge-origem-ag { background: rgba(255,255,255,.08); color: #d1d5db; }
.cli-prop-badge-origem-cli { background: #e0e7ff; color: #3730a3; }
.dark .cli-prop-badge-origem-cli { background: rgba(99,102,241,.2); color: #c7d2fe; }

.cli-prop-cell-forn {
    font-size: 11px; font-weight: 600; color: #374151;
    margin-bottom: 2px; line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dark .cli-prop-cell-forn { color: #d1d5db; }
.cli-prop-cell-orc {
    font-size: 10px; color: #6b7280; margin-bottom: 4px;
}
.dark .cli-prop-cell-orc { color: #9ca3af; }

.cli-prop-warn-multimoeda {
    font-size: 10px; color: #92400e; margin-top: 4px; font-style: italic;
}
.dark .cli-prop-warn-multimoeda { color: #fcd34d; }

.cli-prop-legenda-pendente,
.cli-prop-legenda-aprovada,
.cli-prop-legenda-reprovada {
    display: inline-block; width: 14px; height: 14px; border-radius: 4px;
}
.cli-prop-legenda-pendente { background: #f59e0b; }
.cli-prop-legenda-aprovada { background: #10b981; }
.cli-prop-legenda-reprovada { background: #ef4444; }