body {
    font-family: 'Inter', sans-serif;
    position: relative;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
}

/* ===== ESTILO ESPECÍFICO PARA LOGIN ===== */
#loginContainer {
    background-image: url('https://dualbr.com/wp-content/uploads/2021/08/01-Links-Dedicados.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===== ESTILOS DA SIDEBAR ===== */
.sidebar-link {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #d1d5db; /* gray-400 */
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}
.sidebar-link:hover {
    background-color: #374151; /* gray-700 */
    color: #ffffff;
}
.sidebar-link.active {
    background-color: #ffffff; /* branco */
    color: #374151; /* cinza-700 */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.sidebar-link svg {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* --- Estados Colapsados (Mini Sidebar) --- */
#sidebar.sidebar-collapsed {
    width: 5rem; /* w-20 */
}

#sidebar.sidebar-collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    display: none;
}

#sidebar.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

#sidebar.sidebar-collapsed .sidebar-link svg {
    margin-right: 0;
}

#sidebar.sidebar-collapsed .logo-full {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

#sidebar.sidebar-collapsed .logo-mini {
    opacity: 1;
    pointer-events: auto;
    position: static;
}

/* Modal Transitions */
.modal-backdrop { transition: opacity 0.3s ease; }
.modal-panel { transition: all 0.3s ease; }

/* ===== ESTILOS DO INVENTÁRIO (Novos) ===== */
.sortable-ghost {
    opacity: 0.4;
    background: #e2e8f0;
}
#itemsTableBody tr:not(.no-hover):hover {
    background-color: #f9fafb;
    cursor: pointer;
}

/* ===== ESTILOS DO CALENDÁRIO ===== */

/* Novo container interno para forçar a largura mínima */
.calendar-scroll-content {
    min-width: 1400px; 
    width: 100%;
}

.calendar-grid, .calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)); 
    gap: 1px;
    background-color: #e5e7eb;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    width: 100%; 
}

.calendar-day {
    height: 260px; 
    position: relative;
    background-color: white; /* Fundo branco para a área de eventos */
    padding: 0; /* Padding removido para o header encostar nas bordas */
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

.calendar-day-header {
    font-size: 0.75rem;
    color: #4b5563;
    text-align: left;
    padding: 8px 0;
    padding-left: 8px;
    background-color: #f3f4f6;
    font-weight: 600;
}
.day-number {
    font-size: 0.9rem; /* Fonte levemente maior */
    font-weight: 600;
    text-align: left;
    padding: 8px 12px; /* Aumentado para criar uma barra mais alta */
    flex-shrink: 0;
    background-color: #f3f4f6; /* Fundo cinza APENAS na linha do número */
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}
.other-month .day-number { color: #d1d5db; background-color: #f9fafb; }

/* Barra de rolagem condicional dentro de cada dia (vertical) */
.events-container {
    flex-grow: 1;
    overflow-y: hidden;
    overflow-x: hidden;
    display: block; /* IMPORTANTE: Block para permitir posicionamento absoluto dentro */
    position: relative; /* IMPORTANTE: Referência para o indicador absoluto */
    min-height: 50px; /* Garante área de drop mesmo sem eventos */
    padding: 4px; /* Padding adicionado aqui para os eventos não colarem na borda */
    
    /* Grid Visual: Linha a cada 22px */
    background-image: linear-gradient(to bottom, transparent 21px, #f3f4f6 21px, #f3f4f6 22px);
    background-size: 100% 22px;
    background-position: 0 0;
}

.events-container.has-scrollbar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.events-container.has-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.events-container.has-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.events-container.has-scrollbar::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.events-container.has-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #a1a1aa;
}

.event-bar {
    font-size: 0.75rem;
    padding: 0 6px; 
    line-height: 20px;
    border-radius: 4px;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%; 
    border-left: 3px solid rgba(0,0,0,0.3);
    height: 20px; 
    margin-bottom: 2px;
    position: relative;
    z-index: 10;
    display: block;
}

.event-placeholder { 
    height: 22px; 
    width: 100%;
    display: block;
    pointer-events: none; /* Não interfere no clique ou drag */
}

/* Cores dos eventos */
.event-montagem { background-color: #f59e0b; }
.event-evento { background-color: #10b981; }
.event-visita { background-color: #a1c5ff; }
.event-me { background-color: #8b5cf6; }
.event-negociacao { background-color: #6b7280; }
.event-possibilidade { background-color: #991b1b; }
.event-cancelado { background-color: #d1d5db; color: #374151; } 
/* Novos Tipos */
.event-manutencao { background-color: #171a1f; } /* Slate 500 */
.event-ferias { background-color: #06b6d4; } /* Cyan 500 */

/* Flag para alertas e observações (Triângulo Vermelho na Direita) */
.event-bar::after { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 12px 12px 0; border-color: transparent #ef4444 transparent transparent; display: none; }
.event-bar.has-alert::after { display: block; }

/* NOVA FLAG para Suporte Técnico Contratado (Triângulo Preto no Canto Inferior Direito) */
.event-bar::before { content: ''; position: absolute; bottom: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 0 12px 12px; border-color: transparent transparent #ffe656 transparent; display: none; }
.event-bar.has-support::before { display: block; }
.event-bar.has-support { padding-right: 14px; } /* Evita que o texto encoste e se misture na flag preta */

/* ===== ESTILOS DO CONTROLE DE PONTOS ===== */
.timesheet-grid-container { display: grid; grid-template-columns: 50px repeat(7, 1fr) 120px; gap: 1px; background-color: #e5e7eb; min-width: 800px; }
.timesheet-header { font-size: 0.75rem; color: #4b5563; text-align: left; padding: 8px 0; padding-left: 8px; background-color: #f3f4f6; font-weight: 600; }
.timesheet-week-cell { background-color: #f9fafb; font-weight: bold; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.7rem; padding: 4px 0; border-right: 1px solid #e5e7eb; border-top: 1px solid #e5e7eb; }

/* ALTERAÇÃO: Removido padding de 2px para 0, eliminando a borda branca interna */
.timesheet-day-cell, .timesheet-subtotal-cell { border-top: 1px solid #e5e7eb; padding: 0; }

.timesheet-day { height: 180px; background-color: white; position: relative; display: flex; flex-direction: column; }
.timesheet-day.other-month { background-color: #f9fafb; }

/* ALTERAÇÃO: Fundo escurecido, alinhado à esquerda, com padding e negrito */
.timesheet-day-number { 
    font-size: 0.9rem; 
    text-align: left; 
    padding: 8px 8px; /* ALTERADO: Aumentado padding vertical para 8px */
    color: #6b7280; 
    border-bottom: 1px solid #e5e7eb; 
    background-color: #f3f4f6; /* Fundo alterado conforme solicitado */
    font-weight: bold; /* Adicionado negrito */
}

.timesheet-day-number.today { background-color: #fef3c7; font-weight: bold; }
.timesheet-day.other-month .timesheet-day-number { color: #d1d5db; }
.timesheet-entry { font-size: 0.75rem; text-align: left; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 22px; border-radius: 4px; margin-top: 2px; cursor: pointer; border: 1px solid rgba(0,0,0,0.1); }
.timesheet-subtotal-cell { background-color: #f3f4f6; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; font-weight: bold; }
.timesheet-lane-container { flex-grow: 1; overflow-y: auto; padding-left: 2px; padding-right: 2px;}
.subtotal-value { height: 24px; display:flex; padding-left: 8px; padding-top: 8px;  align-items: left; justify-content: left; font-size: 0.75rem; flex-shrink: 0; }

/* Day Picker Modal */
.day-picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-picker-cell { cursor: pointer; width: 36px; height: 36px; }
.day-picker-cell.selected-day { background-color: #1f2937; color: white; border-color: #1f2937; }

/* Tabelas de Resumo Anual */
.summary-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.8rem; border: 1px solid #e5e7eb; border-radius: 0.5rem; overflow: hidden; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.summary-table th, .summary-table td { padding: 10px 12px; text-align: center; border-bottom: 1px solid #e5e7eb; }
.summary-table td { background-color: white; }
.summary-table th { background-color: #f9fafb; font-weight: 600; color: #374151; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.05em; }
.summary-table .tech-name { text-align: left; font-weight: 500; background-color: #f9fafb; }
.summary-table tbody tr:last-child td { border-bottom: none; }
.summary-table .consolidated-row td { font-weight: bold; background-color: #f3f4f6; border-top: 2px solid #d1d5db; }
.chart-legend-table { margin-top: 1rem; width: 100%; font-size: 0.875rem; }

/* ESTILOS DO CONTROLE DE EVENTOS */
.event-control-table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
.event-control-table th, .event-control-table td { padding: 12px 15px; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 0.875rem; }

/* Sticky Header Logic */
.event-control-table thead th { 
    background-color: #f9fafb; 
    font-weight: 600; 
    color: #374151; 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); 
}

/* === NOVA REGRA DE ZEBRA STRIPING PARA ALTERNAR CORES === */
.event-control-table tbody tr:nth-child(even) { background-color: #f9fafb; }
.event-control-table tbody tr:hover { background-color: #f3f4f6; }

.status-badge { padding: 4px 10px; border-radius: 9999px; font-weight: 500; font-size: 0.75rem; text-transform: capitalize; white-space: nowrap; }
.status-realizado { background-color: #d1fae5; color: #065f46; }
.status-em-andamento { background-color: #f0f7b4; color: #7a6503; }
.status-nao-realizado { background-color: #fee2e2; color: #991b1b; }

/* ===== ESTILOS DO SISTEMA DE LISTAS (DINÂMICO) ===== */
.lists-editable[contenteditable="true"] {
    outline: 2px dashed #6366f1;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: text;
    background-color: #eef2ff; 
}
.lists-editable[contenteditable="true"]:focus {
    background-color: #e0e7ff; 
    outline-color: #4f46e5;
}

.lists-edit-control { display: none !important; }
.lists-editing-mode .lists-edit-control { display: inline-flex !important; }

.lists-remove-btn {
    color: #ef4444; 
    cursor: pointer;
    margin: 0 8px;
}
.lists-remove-btn:hover { color: #dc2626; }

.lists-drag-handle {
    color: #9ca3af; 
    cursor: move;
}
.lists-section-block.dragging {
    opacity: 0.5;
    border: 2px dashed #6366f1;
}

/* Toast Notification */
#lists-toast-notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transition: opacity 0.5s, bottom 0.5s;
    opacity: 0;
}

/* Client Card Delete Button */
.lists-client-card .remove-client-btn {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ef4444;
    color: white;
    border-radius: 9999px;
    width: 28px;
    height: 28px;
    font-weight: bold;
    line-height: 28px;
    cursor: pointer;
}
.lists-grid-editing .lists-client-card .remove-client-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lists-edit-placeholder-btn, .lists-edit-options-btn {
    color: #4f46e5;
    margin-left: 8px;
}
.lists-edit-placeholder-btn:hover, .lists-edit-options-btn:hover {
    color: #3730a3;
}
.lists-record-row:hover { background-color: #f9fafb; }