/* Base e helpers */
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
.ui-helper-clearfix:after { clear: both; }
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; }

.ui-front { z-index: 100; }

/* Bordas e sombras - Estilo Retrô */
.ui-widget.ui-widget-content {
    border: 2px solid #2f193d;
    border-radius: 6px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    font-family: "Rubik", sans-serif;
}

/* Cabeçalhos UI Widget - Estilo Retrô */
.ui-widget-header {
    border: none;
    background: #2f193d;
    color: #ffffff;
    font-weight: 600;
    font-family: "Space Mono", monospace;
    position: relative;
}

.ui-widget-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #0e6875;
    z-index: 1;
}

/* Conteúdo UI Widget */
.ui-widget-content {
    border: 1px solid #e2e0dc;
    background: #ffffff;
    color: #24292f;
}

/* Estados de interação */
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default,
.ui-button {
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s;
}

.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus,
.ui-button:hover,
.ui-button:focus {
    border: 1px solid #2f193d;
    background: rgba(47, 25, 61, 0.05);
    color: #2f193d;
}

.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
    border: 1px solid #2f193d;
    background: #2f193d;
    font-weight: 500;
    color: #ffffff;
}

/* Estados de destaque */
.ui-state-highlight,
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
    border: 1px solid #0e6875;
    background: rgba(14, 104, 117, 0.1);
    color: #0e6875;
}

/* Estados de erro */
.ui-state-error,
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
    border: 1px solid #dc3545;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Botões */
.ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid #2f193d;
    background-color: #ffffff;
    color: #2f193d;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.ui-button:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
    background-color: rgba(47, 25, 61, 0.05);
}

.ui-button:active {
    transform: translateY(0);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

/* Datepicker customizado */
.ui-datepicker {
    padding: 0;
    width: 300px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    border: 2px solid #2f193d;
}

.ui-datepicker .ui-datepicker-header {
    padding: 0.75rem;
    border-bottom: 2px solid #e2e0dc;
}

.ui-datepicker .ui-datepicker-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    top: 12px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border: none;
}

.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    margin-top: -6px;
    margin-left: -6px;
}

.ui-datepicker table {
    font-size: 0.875rem;
    margin: 0;
    border-collapse: collapse;
}

.ui-datepicker th {
    padding: 0.5rem;
    text-align: center;
    font-weight: 500;
    color: #2f193d;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e2e0dc;
}

.ui-datepicker td {
    padding: 0;
    border: 1px solid #e2e0dc;
}

.ui-datepicker td a,
.ui-datepicker td span {
    padding: 0.5rem;
    text-align: center;
}

.ui-datepicker td a.ui-state-default {
    border: none;
    background: transparent;
}

.ui-datepicker td a.ui-state-default:hover {
    background: rgba(47, 25, 61, 0.05);
    color: #2f193d;
}

.ui-datepicker td a.ui-state-active {
    background: #2f193d;
    color: #ffffff;
    border-radius: 4px;
}

.ui-datepicker td a.ui-state-highlight {
    background: rgba(14, 104, 117, 0.1);
    color: #0e6875;
    border-radius: 4px;
}

.ui-datepicker .ui-datepicker-buttonpane {
    border-top: 1px solid #e2e0dc;
    margin: 0;
    padding: 0.5rem;
}

.ui-datepicker .ui-datepicker-buttonpane button {
    margin: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Dialog customizado */
.ui-dialog {
    padding: 0;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
    border: 2px solid #2f193d;
    border-radius: 8px;
    overflow: hidden;
}

.ui-dialog .ui-dialog-titlebar {
    padding: 1rem;
    border-bottom: 1px solid #e2e0dc;
    font-family: "Space Mono", monospace;
}

.ui-dialog .ui-dialog-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: #ffffff;
}

.ui-dialog .ui-dialog-titlebar-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    top: 50%;
    margin-top: -14px;
    right: 10px;
    color: #ffffff;
}

.ui-dialog .ui-dialog-titlebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ui-dialog .ui-dialog-content {
    padding: 1rem;
    font-family: "Nunito Sans", sans-serif;
}

.ui-dialog .ui-dialog-buttonpane {
    border-top: 1px solid #e2e0dc;
    background: #f8f9fa;
    padding: 0.75rem 1rem;
}

/* Autocomplete */
.ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 2px solid #2f193d;
    border-radius: 0 0 6px 6px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    background: #ffffff;
    padding: 0.25rem;
}

.ui-autocomplete .ui-menu-item-wrapper {
    padding: 0.5rem;
    border-radius: 4px;
}

.ui-autocomplete .ui-menu-item-wrapper.ui-state-active {
    margin: 0;
    background: rgba(47, 25, 61, 0.1);
    color: #2f193d;
    border: none;
}

/* Tabs */
.ui-tabs {
    padding: 0;
    border: 2px solid #2f193d;
    border-radius: 8px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

.ui-tabs .ui-tabs-nav {
    padding: 0.5rem 0.5rem 0 0.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e0dc;
    border-radius: 6px 6px 0 0;
}

.ui-tabs .ui-tabs-nav li {
    margin: 0 0.25rem 0 0;
    border: 1px solid #e2e0dc;
    border-radius: 6px 6px 0 0;
    background: #f8f9fa;
}

.ui-tabs .ui-tabs-nav li.ui-tabs-active {
    margin-bottom: -1px;
    padding-bottom: 1px;
    background: #ffffff;
    border-bottom-color: #ffffff;
}

.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
    padding: 0.5rem 1rem;
    font-family: "Space Mono", monospace;
    font-size: 0.875rem;
    color: #495057;
}

.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
    color: #2f193d;
    font-weight: 600;
}

.ui-tabs .ui-tabs-panel {
    padding: 1rem;
    border-radius: 0 0 6px 6px;
}

/* Sliders */
.ui-slider {
    background: #f0f2f5;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    height: 6px;
}

.ui-slider .ui-slider-range {
    background: #2f193d;
    border-radius: 4px;
}

.ui-slider .ui-slider-handle {
    width: 22px;
    height: 22px;
    background: #ffffff;
    border: 2px solid #2f193d;
    border-radius: 50%;
    cursor: pointer;
    top: -8px;
    margin-left: -11px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ui-slider .ui-slider-handle:hover {
    transform: scale(1.1);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

.ui-slider .ui-slider-handle:active {
    transform: scale(1);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

/* Progressbar */
.ui-progressbar {
    height: 12px;
    background: #f0f2f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.ui-progressbar .ui-progressbar-value {
    background: #2f193d;
    border-radius: 6px;
    margin: 0;
    transition: width 0.3s ease;
}

/* Tooltip */
.ui-tooltip {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: #ffffff;
    color: #343a40;
    border: 2px solid #2f193d;
    border-radius: 6px;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
    max-width: 300px;
    font-family: "Nunito Sans", sans-serif;
}

/* Menu */
.ui-menu {
    padding: 0.25rem;
    background: #ffffff;
    border: 2px solid #2f193d;
    border-radius: 6px;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

.ui-menu .ui-menu-item-wrapper {
    padding: 0.5rem;
    border-radius: 4px;
}

.ui-menu .ui-menu-item-wrapper.ui-state-active {
    background: rgba(47, 25, 61, 0.1);
    color: #2f193d;
    border: none;
    margin: 0;
}

/* Accordion */
.ui-accordion .ui-accordion-header {
    padding: 0.75rem 1rem;
    margin-top: 0.25rem;
    font-family: "Space Mono", monospace;
    font-weight: 500;
    background: #f8f9fa;
    border: 1px solid #e2e0dc;
    border-radius: 6px;
    transition: all 0.2s;
}

.ui-accordion .ui-accordion-header:first-child {
    margin-top: 0;
}

.ui-accordion .ui-accordion-header.ui-state-active {
    background: #2f193d;
    color: #ffffff;
    border-color: #2f193d;
    border-radius: 6px 6px 0 0;
}

.ui-accordion .ui-accordion-content {
    padding: 1rem;
    border: 1px solid #e2e0dc;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

/* Select menu */
.ui-selectmenu-button.ui-button {
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 2px solid #2f193d;
    border-radius: 6px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.ui-selectmenu-button.ui-button:hover {
    background: rgba(47, 25, 61, 0.05);
}

.ui-selectmenu-icon.ui-icon {
    margin-top: 0;
    right: 0.5rem;
}

.ui-selectmenu-menu .ui-menu {
    max-height: 300px;
}

/* Spinner */
.ui-spinner {
    width: 100%;
}

.ui-spinner-input {
    width: calc(100% - 2em);
    margin: 0;
    padding: 0.5rem;
    box-sizing: border-box;
}

.ui-spinner-button {
    width: 2em;
    cursor: pointer;
}

.ui-spinner-up {
    border-bottom: 1px solid #dee2e6;
}

/* Checkboxradio */
.ui-checkboxradio-label {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
}

.ui-checkboxradio-label.ui-state-active {
    background: #2f193d;
    color: #ffffff;
    border-color: #2f193d;
}

.ui-checkboxradio-icon {
    width: 16px;
    height: 16px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    margin-right: 0.25rem;
}

.ui-checkboxradio-radio-label .ui-checkboxradio-icon {
    border-radius: 50%;
}

.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon {
    background-color: #2f193d;
    border-color: #2f193d;
}

/* Ícones - substituições */
.ui-icon {
    width: 16px;
    height: 16px;
    background-image: none;
    position: relative;
    display: inline-block;
}

/* Estilos para ícones específicos */
.ui-datepicker .ui-icon-circle-triangle-w:before,
.ui-datepicker .ui-icon-circle-triangle-e:before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-style: solid;
    border-width: 2px 0 0 2px;
    border-color: #fff;
    top: 50%;
    left: 50%;
    transform: translate(-30%, -50%) rotate(-45deg);
}

.ui-datepicker .ui-icon-circle-triangle-e:before {
    transform: translate(-70%, -50%) rotate(135deg);
}

.ui-dialog .ui-icon-closethick:before {
    content: "×";
    position: absolute;
    width: 100%;
    height: 100%;
    top: -2px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    text-indent: 0;
}

/* Ajustes para dispositivos móveis */
@media (max-width: 576px) {
    .ui-datepicker {
        width: 280px;
    }

    .ui-dialog {
        width: 95% !important;
        max-width: 95%;
    }
}

/* Estilos diretos para os botões de diálogo */
.ui-dialog-buttonpane button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 2px solid #2f193d;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: "Space Mono", monospace;
    font-weight: 500;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    min-width: 80px;
    background-color: #ffffff;
    color: #2f193d;
    cursor: pointer;
    margin: 0 0.25rem;
}

.ui-dialog-buttonpane button:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    background-color: rgba(47, 25, 61, 0.05);
}

.ui-dialog-buttonpane button:active {
    transform: translateY(1px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Botão primário (geralmente o primeiro botão) */
.ui-dialog-buttonpane button:first-of-type {
    background-color: #2f193d;
    color: #ffffff;
}

.ui-dialog-buttonpane button:first-of-type:hover {
    background-color: #22112c;
}

/* Botão secundário (geralmente o segundo botão) */
.ui-dialog-buttonpane button:nth-of-type(2) {
    background-color: #ffffff;
    border-color: #6c757d;
    color: #6c757d;
}

.ui-dialog-buttonpane button:nth-of-type(2):hover {
    background-color: #f8f9fa;
    border-color: #2f193d;
    color: #2f193d;
}

/* Ajuste do container de botões */
.ui-dialog-buttonset {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Overlay para o efeito modal */
.ui-widget-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
}

/* Ajuste para o z-index do diálogo */
.ui-dialog {
    position: fixed;
    z-index: 1000;
    padding: 0;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
    border: 2px solid #2f193d;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

/* Animação de entrada para o diálogo */
.ui-dialog {
    animation: dialog-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

@keyframes dialog-pop {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Prevenção de scroll do body quando o modal está aberto */
body.ui-dialog-open {
    overflow: hidden;
}

/* Ajuste para o botões de diálogo */
.ui-dialog-buttonpane {
    background-color: #f8f9fa;
    padding: 1rem;
    margin-top: 0;
    border-top: 1px solid #e2e0dc;
}

.ui-dialog-buttonpane button {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 2px solid #2f193d;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: "Space Mono", monospace;
    font-weight: 500;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    min-width: 80px;
    background-color: #ffffff;
    color: #2f193d;
    cursor: pointer;
    margin: 0 0.25rem;
}

.ui-dialog-buttonpane button:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    background-color: rgba(47, 25, 61, 0.05);
}

.ui-dialog-buttonpane button:active {
    transform: translateY(1px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Botão primário */
.ui-dialog-buttonpane button:first-of-type {
    background-color: #2f193d;
    color: #ffffff;
}

.ui-dialog-buttonpane button:first-of-type:hover {
    background-color: #22112c;
}

/* Botão secundário */
.ui-dialog-buttonpane button:nth-of-type(2) {
    background-color: #ffffff;
    border-color: #6c757d;
    color: #6c757d;
}

.ui-dialog-buttonpane button:nth-of-type(2):hover {
    background-color: #f8f9fa;
    border-color: #2f193d;
    color: #2f193d;
}