/* ========================================
   DRAWER: FILTROS AVANÇADOS
   ======================================== */

/* Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 200ms ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Container */
.drawer-container {
    position: relative;
    background: #FFFFFF;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    animation: slideIn 300ms ease forwards;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

.drawer-filtros {
    width: 400px;
    max-width: 90vw;
}

/* Header */
.drawer-filtros .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E7E9E9;
    background: #FFFFFF;
}

.drawer-filtros .drawer-title {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #18191A;
    margin: 0;
    line-height: 1.3;
}

.drawer-filtros .btn-close-drawer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #717182;
    cursor: pointer;
    transition: all 200ms ease;
    flex-shrink: 0;
}

.drawer-filtros .btn-close-drawer:hover {
    background: #F3F4F6;
    color: #0A0A0A;
}

.drawer-filtros .btn-close-drawer i {
    width: 20px;
    height: 20px;
}

/* Body */
.drawer-filtros .drawer-body {
    padding: 24px !important;
    overflow-y: auto !important;
    height: calc(100% - 140px) !important;
    background: #FFFFFF !important;
}

/* Filter Section */
.filter-section {
    margin-bottom: 24px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-title {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #18191A;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.filter-section-title-caps {
    font-family: 'Archivo', -apple-system, sans-serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #697282 !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.3 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: block !important;
}

/* Date Grid (2 campos lado a lado) */
.filter-date-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
}

/* Date Inputs */
.filter-date-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #E7E9E9;
    border-radius: 6px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    color: #18191A;
    background: #FFFFFF;
    transition: all 200ms ease;
}

.filter-date-input:focus {
    outline: none;
    border-color: #0068AB;
    box-shadow: 0 0 0 3px rgba(0, 104, 171, 0.1);
}

.filter-date-input::placeholder {
    color: #9CA3AF;
}

/* Checkboxes */
.filter-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #E7E9E9;
    border-radius: 4px;
    background: #FFFFFF;
    cursor: pointer;
    position: relative;
    transition: all 200ms ease;
    flex-shrink: 0;
}

.filter-checkbox:checked {
    background: #0068AB;
    border-color: #0068AB;
}

.filter-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox-label {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    color: #18191A;
    cursor: pointer;
    line-height: 1.3;
}

/* Range Slider */
.filter-range-container {
    padding: 8px 0;
}

.filter-range-value {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #0068AB;
    margin-bottom: 12px;
    line-height: 1.3;
}

.filter-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #E7E9E9;
    outline: none;
    cursor: pointer;
}

.filter-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0068AB;
    cursor: pointer;
    transition: all 200ms ease;
}

.filter-range::-webkit-slider-thumb:hover {
    background: #064974;
    box-shadow: 0 0 0 4px rgba(0, 104, 171, 0.1);
}

.filter-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0068AB;
    cursor: pointer;
    border: none;
    transition: all 200ms ease;
}

.filter-range::-moz-range-thumb:hover {
    background: #064974;
    box-shadow: 0 0 0 4px rgba(0, 104, 171, 0.1);
}

.filter-range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.filter-range-label {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    color: #697282;
    line-height: 1.3;
}

.filter-range-value-center {
    font-family: 'Archivo', -apple-system, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0068AB !important;
    line-height: 1.3 !important;
}

/* Select/Dropdown */
.filter-select {
    width: 100% !important;
    height: 40px !important;
    padding: 0 12px !important;
    border: 1px solid #E7E9E9 !important;
    border-radius: 6px !important;
    font-family: 'Archivo', -apple-system, sans-serif !important;
    font-size: 13px !important;
    color: #18191A !important;
    background: #FFFFFF !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23697282' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer !important;
    transition: all 200ms ease !important;
}

.filter-select:focus {
    outline: none !important;
    border-color: #0068AB !important;
    box-shadow: 0 0 0 3px rgba(0, 104, 171, 0.1) !important;
}

.filter-select option {
    color: #18191A;
}

/* Button Group (Ordenar por) */
.filter-button-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.filter-button {
    padding: 8px 16px !important;
    background: #F3F4F6 !important;
    border: 1px solid #E7E9E9 !important;
    border-radius: 6px !important;
    font-family: 'Archivo', -apple-system, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #697282 !important;
    cursor: pointer !important;
    transition: all 200ms ease !important;
    line-height: 1 !important;
}

.filter-button:hover {
    background: #E7E9E9 !important;
    color: #18191A !important;
}

.filter-button.active {
    background: #0068AB !important;
    color: #FFFFFF !important;
    border-color: #0068AB !important;
}

/* Radio Buttons */
.filter-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-radio {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #E7E9E9;
    border-radius: 50%;
    background: #FFFFFF;
    cursor: pointer;
    position: relative;
    transition: all 200ms ease;
    flex-shrink: 0;
}

.filter-radio:checked {
    border-color: #0068AB;
}

.filter-radio:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0068AB;
}

.filter-radio-label {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    color: #18191A;
    cursor: pointer;
    line-height: 1.3;
}

/* Footer */
.drawer-filtros .drawer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    border-top: 1px solid #E7E9E9;
    background: #FFFFFF;
    display: flex;
    gap: 12px;
}

.btn-limpar-filtros {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    background: #FFFFFF;
    border: 1px solid #E7E9E9;
    border-radius: 6px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #18191A;
    cursor: pointer;
    transition: all 200ms ease;
    line-height: 1;
}

.btn-limpar-filtros:hover {
    background: #F9FAFA;
}

.btn-aplicar-filtros {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    background: #0068AB;
    border: none;
    border-radius: 6px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 200ms ease;
    line-height: 1;
}

.btn-aplicar-filtros:hover {
    background: #064974;
}

/* Date Column (para Data Inicial e Data Final separados) */
.filter-date-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Title with Icon (para título com ícone de ajuda) */
.filter-section-title-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #9CA3AF;
    cursor: pointer;
    transition: all 200ms ease;
    padding: 0;
    flex-shrink: 0;
}

.filter-help-icon:hover {
    color: #0068AB;
    background: rgba(0, 104, 171, 0.1);
}

.filter-help-icon i {
    width: 16px;
    height: 16px;
}

/* Radio Buttons */
.filter-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-radio {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #E7E9E9;
    border-radius: 50%;
    background: #FFFFFF;
    cursor: pointer;
    position: relative;
    transition: all 200ms ease;
    flex-shrink: 0;
}

.filter-radio:checked {
    border-color: #0068AB;
    border-width: 2px;
}

.filter-radio:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0068AB;
}

.filter-radio-label {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    color: #18191A;
    cursor: pointer;
    line-height: 1.3;
}

/* Responsivo */
@media (max-width: 768px) {
    .drawer-filtros {
        width: 100%;
        max-width: 100vw;
    }

    .drawer-filtros .drawer-body {
        height: calc(100% - 160px);
    }
}
