
/* ============================================= */
/* ============ ESTILOS GERAIS ================ */
/* ============================================= */

/* Cores modernas */
:root {
  --primary: #2563eb;       /* Azul mais vibrante */
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  --secondary: #0d9488;    /* Turquesa mais suave */
  --light: #f8fafc;
  --dark: #1e293b;
  --success: #10b981;
  --info: #0ea5e9;
  --warning: #f59e0b;
  --danger: #ef4444;
  --card-bg: rgba(255, 255, 255, 0.96);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ✅ ESTILOS PARA DRAG & DROP */
.fc-event-dragging {
    opacity: 0.7;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 9999 !important;
}

.fc-event-resizing {
    opacity: 0.8;
    border: 2px dashed #007bff !important;
}

/* Feedback visual durante o arrasto */
.fc-highlight {
    background: rgba(0, 123, 255, 0.1) !important;
}

/* Melhora a usabilidade dos eventos */
.fc-event {
    cursor: move !important; /* cursor de arrastar */
    transition: all 0.2s ease;
}

.fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Indicador visual para eventos que estão sendo arrastados */
.event-dragging {
    opacity: 0.7;
    transform: scale(1.02);
}


/* Estilos para resultados de pesquisa */
.search-results-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.search-results-header h5 {
    margin: 0;
    color: #007bff;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-result-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-result-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.search-result-title {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
}

.search-result-section {
    margin-bottom: 15px;
}

.search-result-section h7 {
    display: block;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 8px;
    font-size: 14px;
}

.search-result-field {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.4;
}

.search-result-field strong {
    color: #495057;
    min-width: 120px;
    display: inline-block;
}

.search-result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.view-details-btn {
    font-size: 12px;
    padding: 4px 12px;
}

/* Responsividade */
@media (max-width: 768px) {
    .search-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .search-result-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .search-result-field strong {
        min-width: 100px;
    }
}

.agenda-container {
    height: 80vh;  /* Ajusta a altura para 80% da altura da tela */
    overflow-y: auto;  /* Adiciona rolagem se o conteúdo for grande */
}

/* Estilos para visualização em lista */
.fc-list-event {
    border-left: 4px solid #3788d8;
    margin-bottom: 5px;
    border-radius: 4px;
}

.fc-list-event:hover {
    background-color: #f8f9fa !important;
    transform: translateX(2px);
    transition: all 0.2s ease;
}

.fc-list-event-title {
    font-weight: 500;
    font-size: 14px;
}

.fc-list-event-time {
    font-weight: 600;
    color: #495057;
}

/* Botão de lista personalizado */
.fc-listWeek-button {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.fc-listWeek-button:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}

/* Botão de limpar pesquisa */
#clearSearchBtn {
    margin-left: 5px;
    display: none;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-toolbar-chunk {
        width: 100%;
        justify-content: center;
    }
    
    #searchInput {
        width: 100% !important;
        margin-bottom: 10px;
    }
}

/* Container principal para os gráficos */
.chart-container {
    position: relative;
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--card-shadow);
}

/* Wrapper para o canvas do gráfico */
.chart-wrapper {
    position: relative;
    height: 300px;
    min-height: 300px;
    max-height: 300px;
}

/* Ajustes específicos para cada tipo de gráfico */
#dailySalesChart,
#certificateChart,
#partnerStatusChart,
#stateChart {
    width: 100% !important;
    height: 100% !important;
    min-height: 300px;
    max-height: 300px;
}

/* Container principal da agenda */
#calendar-container {
            position: relative;
            width: 100%;
            height: 80vh; /* Ocupa 80% da altura da viewport */
            min-height: 600px; /* Altura mínima para evitar que fique muito pequeno */
            padding: 0;
            margin: 0;
            background: white;
            border-radius: 12px;
            box-shadow: var(--card-shadow);
            overflow: hidden;
        }

/* Header da agenda */
.calendar-header {
    background: var(--primary-gradient);
    padding: 1rem;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Calendário ocupando toda a área disponível */
#calendar {
    width: 100%;
    height: calc(100% - 70px) !important; /* Altura total menos header */
    min-height: calc(100% - 70px) !important;
    padding: 0;
    margin: 0;
}


/* Manter a proporção em telas menores */
@media (max-width: 768px) {
    .chart-wrapper {
        height: 250px;
        min-height: 250px;
        max-height: 250px;
    }
    
    #dailySalesChart,
    #certificateChart,
    #partnerStatusChart,
    #stateChart {
        min-height: 250px;
        max-height: 250px;
    }
}

.table-responsive {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
}

.card {
    margin-bottom: 24px;
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: var(--card-bg);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h4, .card-header h5 {
    font-weight: 600;
    margin: 0;
}

.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-gradient);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-logout {
    transition: all 0.3s;
    border-radius: 8px;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2);
}

.is-invalid {
    border-color: #dc3545 !important;
}
.invalid-feedback {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

.spinner-border {
    vertical-align: middle;
    margin-right: 0.5rem;
}

.navbar {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background: var(--primary-gradient) !important;
    padding: 0.5rem 1rem;
}

.nav-link {
    border-radius: 8px;
    margin: 0 2px;
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-top: 8px;
}

.dropdown-item {
    border-radius: 6px;
    margin: 2px 6px;
    width: auto;
}

.dropdown-item:hover {
    background: var(--light);
}

/* login.html - adicione ao CSS */
.card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1.5rem;
    text-align: center;
}

.card-body {
    padding: 2rem;
}

.input-group-text {
    background: var(--light);
    border: none;
}

.form-control {
    border-left: none;
    padding: 0.75rem;
    background: var(--light);
    border-color: #e2e8f0;
}

.form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.btn-submit {
    padding: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Efeitos hover em elementos interativos */
a, button, .btn, .nav-link, .dropdown-item {
    transition: all 0.2s ease;
}

/* Animação para alerts */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert {
    animation: fadeIn 0.3s ease forwards;
}

/* Efeito de loading */
.spinner-border {
    width: 1.2rem;
    height: 1.2rem;
    border-width: 0.15em;
}

/* Tipografia melhorada */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #334155;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #1e293b;
}

.display-6 {
    font-weight: 700;
}

.text-muted {
    color: #64748b !important;
}

/* Melhoria nos títulos dos cards */
.card-header h4, .card-header h5 {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.card-header .bi {
    margin-right: 0.5rem;
}

/* Adicione ao seu style.css */
.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #64748b;
}

.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 6px;
}

.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-info { background-color: var(--info) !important; }
.bg-secondary { background-color: var(--secondary) !important; }


.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease;
    transform: translate(0, -50px);
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: translate(0, 0);
    opacity: 1;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}
/* ============================================= */
/* ========== ESTILOS FULLCALENDAR ============ */
/* ============================================= */
/* Reset da estrutura do calendário */
.fc-timegrid-slots table {
    position: relative !important;
}
.fc-timegrid-slots tbody {
    display: table-row-group !important;
}
.fc-timegrid-slots tr {
    height: 1.8em !important; /* Altura reduzida das linhas */
}

/* Coluna de eventos */
.fc-timegrid-col-events {
    position: relative !important;
    height: auto !important;
}

/* Container que agrupa múltiplos eventos sobrepostos */
.fc-timegrid-event-harness-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 1.8em !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: stretch !important;
    align-items: stretch !important;
    overflow: visible !important;
    gap: 4px !important;
    z-index: 1 !important;
    padding: 0 !important;
}

/* Cada evento individual */
.fc-timegrid-event-harness {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    height: 100% !important;
}

/* Estilo visual do evento */
.fc-timegrid-event {
    width: 100% !important;
    height: 100% !important;
    padding: 2px 6px !important;
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
    border-radius: 6px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    overflow: hidden !important;
    border-left: 3px solid !important;
    min-height: 22px !important;
}

/* Conteúdo interno */
.fc-event-main {
     display: block !important;
    padding: 0 !important;
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding-right: 70px !important; /* CORRIGIDO COM ; */
}

.fc-event-time {
   display: block !important;
    font-weight: bold;
    font-size: 0.7rem !important;
    line-height: 1 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc-event-title {
     display: block !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Badge AGR */
.ager-badge {
  position: absolute !important;
    top: 3px !important;
    right: 6px !important;
    font-size: 0.6rem !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    font-weight: bold !important;
    color: #fff !important;
    background-color: rgba(0, 0, 0, 0.65) !important;
    pointer-events: none !important;
    z-index: 2 !important;
    line-height: 1.2 !important;
    max-width: 60px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Cores por status */
.event-status-agendado {
    background-color: #F08080 !important;
    color: #F08080 !important;
    border-left-color: #F08080 !important;
}
.event-status-pago {
    background-color: #28a745 !important;
    color: #28a745 !important;
    border-left-color:  #28a745 !important;
}
.event-status-pendente_pagamento {
    background-color: #eaf207 !important;
    color: #eaf207 !important;
    border-left-color: #eaf207 !important;
}
.event-status-em_atendimento {
    background-color: #138496 !important;
    color: #138496 !important;
    border-left-color: #138496 !important;
}
.event-status-cancelado {
    background-color: #dc3545 !important;
    color: #dc3545 !important;
    border-left-color: #dc3545 !important;
    text-decoration: line-through !important;
}
.event-status-em_analise {
    background-color: #55B080 !important;
    color: #55B080 !important;
    border-left-color: #55B080 !important;
}
.event-status-cobrado {
    background-color: #828BC2 !important;
    color: #828BC2 !important;
    border-left-color: #828BC2 !important;
}
.event-status-isento {
    background-color: #8B008B !important;
    color: #8B008B !important;
    border-left-color: #8B008B !important;
}
.event-status-pendente_doc {
    background-color: #55B080 !important;
    color: #55B080 !important;
    border-left-color: #55B080 !important;
}
.event-status-desistencia {
    background-color: #808080 !important;
    color: #808080 !important;
    border-left-color: #808080 !important;
    text-decoration: line-through !important;
}

/* Cores por AGR */
.event-ager-alisson { border-left-color: #3498db !important; }
.event-ager-beatriz { border-left-color: #e83e8c !important; }
.event-ager-yago { border-left-color: #1a237e !important; }
.event-ager-Enzo {border-left-color: #000000 !important;}
.event-ager-eduarda {border-left-color: #FF004C !important;}

/* Efeito hover */
.fc-event:hover {
    z-index: 10 !important;
    box-shadow: 0 0 4px rgba(0,0,0,0.2) !important;
    transform: scale(1.02);
}


/* ============================================= */
/* ========== COMPONENTES MODAIS ============== */
/* ============================================= */

.modal.fade {
    transition: opacity 0.15s linear;
}
.modal-body {
    padding: 10px;
}
.modal-body h5 {
    color: #000000;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding-right: 0.5rem;
}
.modal-body p {
    margin-bottom: 8px;
}
.modal-body strong {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
    display: inline-block;
}
.modal-footer {
    border-top: 1px solid #dee2e6;
}


/* ============================================= */
/* ========== FORMULÁRIOS ===================== */
/* ============================================= */

#quickEditForm {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}
#quickEditForm .form-select-sm, 
#quickEditForm .form-control-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}
#quickEditForm button[type="submit"] {
    margin-top: 10px;
}
#slotAlert {
    transition: all 0.3s ease;
}


/* ============================================= */
/* ========== RESPONSIVIDADE ================== */
/* ============================================= */

@media (max-width: 768px) {
    .fc-toolbar-title { font-size: 1.2em; }

    .fc-timegrid-event-harness {
        flex: 0 0 45% !important;
    }

    .modal-body h5 { font-size: 1rem; }
    .modal-body strong { min-width: 100px; }
}

@media (max-width: 576px) {
    .fc-timegrid-event-harness {
        flex: 0 0 100% !important;
        margin-right: 0 !important;
        margin-bottom: 2px !important;
    }
    .modal-body { padding: 15px; }
    .modal-body h5 { font-size: 0.9rem; }
    .modal-body strong {
        display: block;
        min-width: auto;
        margin-bottom: 2px;
    }
}

/* Estilos para o logo */
.header-logo {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

/* Ajustes para mobile */
@media (max-width: 768px) {
    .header-logo {
        height: 40px;
    }
    .header-brand-text {
        display: none;
    }
}

    .chart-container {
        position: relative;
        height: 300px;
    }
    .chart-wrapper {
        height: 100%;
    }
    .card-header {
        font-weight: 600;
    }
    /* Estilo para os novos cards */
    .card.bg-secondary {
        background-color: #6c757d !important;
    }
    .card.bg-info {
        background-color: #17a2b8 !important;
    }
    .card.bg-dark {
        background-color: #343a40 !important;
    }
    
    /* Estilos para o Mapa de Resultados */
    #resultsMapContainer .card {
        transition: all 0.3s ease;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    #resultsMapContainer .card:hover {
        transform: translateY(-3px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    }
    
    #resultsMapContainer .card-header {
        font-weight: 600;
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    #resultsMapContainer .card-body {
        padding: 1rem;
    }
    
    #resultsMapContainer .table {
        font-size: 0.85rem;
        margin-bottom: 0;
    }
    
    #resultsMapContainer .table th, 
    #resultsMapContainer .table td {
        padding: 0.5rem;
    }
    
    #resultsMapContainer .progress {
        height: 8px;
        border-radius: 4px;
    }
