/* Custom styles to override theme defaults */

.ti-form-input:focus,
input.ti-form-input:focus,
select.ti-form-input:focus,
textarea.ti-form-input:focus {
    border-color: var(--patrial-primary, #047857) !important;
    box-shadow: 0 0 0 1px var(--patrial-primary, #047857) !important;
    outline: none;
}

.ti-form-checkbox:focus {
    --tw-ring-color: var(--patrial-primary, #047857);
}

.app-sidebar span.side-menu__item[role="button"] {
    cursor: pointer;
    display: flex;
}

.app-sidebar .main-sidebar-header {
    background-color: white !important;
    background-image: none !important;
    border-right: 1px solid #F3F3F3 !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

[dir="ltr"] .app-sidebar {
    left: 0px;
    border-right-width: 0 !important;
}

.app-sidebar .main-sidebar-header .header-logo {
    color: var(--patrial-primary, #047857) !important;
}

[data-nav-layout="vertical"][data-theme-mode="dark"] .app-sidebar .main-sidebar-header {
    background-color: white !important;
    background-image: none !important;
    border-right: 1px solid rgb(var(--header-border-color)) !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

html[data-nav-layout="vertical"],
body[data-nav-layout="vertical"] {
    min-height: 100vh;
}

.content-with-footer {
    min-height: calc(100vh - 71px);
}

html[data-nav-layout="vertical"] .main-content,
body[data-nav-layout="vertical"] .main-content {
    transition: margin-left 0.3s ease;
    flex: 1;
    min-width: 0;
    padding: 1rem 2rem;
}

#footer-main {
    transition: margin-left 0.3s ease;
    padding: 1rem 2rem;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    [dir="ltr"] html[data-nav-layout="vertical"] #footer-main,
    [dir="ltr"] body[data-nav-layout="vertical"] #footer-main {
        margin-left: 0;
    }
}

html[data-nav-layout="vertical"][data-vertical-style="closed"] .main-content,
html[data-nav-layout="vertical"][data-nav-style="icon"] .main-content,
body[data-nav-layout="vertical"][data-vertical-style="closed"] .main-content,
body[data-nav-layout="vertical"][data-nav-style="icon"] .main-content {
    margin-left: 0;
}

html[data-nav-layout="vertical"][data-vertical-style="overlay"] .main-content,
html[data-nav-layout="vertical"].toggle-sidebar .main-content,
body[data-nav-layout="vertical"][data-vertical-style="overlay"] .main-content,
body[data-nav-layout="vertical"].toggle-sidebar .main-content {
    margin-left: 0;
}

[data-footer-position="fixed"] #footer-main {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 100;
}

.dark #footer-main {
    background-color: rgb(var(--dark-bg)) !important;
    border-top: 1px solid rgb(var(--dark-border)) !important;
}

.ti-form-label.mb-0 {
    margin-bottom: 0;
}

.space-y-2 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.5rem;
}

@media (min-width: 992px) {
    .pat-apoio-cards {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.pat-dashboard .box {
    border-radius: 0.75rem;
}

.pat-dashboard .box-header {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

.pat-dashboard .box-footer {
    border-bottom-right-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
}

.pat-apoio-cards .box {
    transition: box-shadow 0.2s ease;
}

.pat-apoio-cards .box:hover {
    box-shadow: 0 8px 24px var(--patrial-hover-shadow, rgba(16, 185, 129, 0.18));
}

@media (min-width: 992px) {
    .pat-natureza-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .pat-charts-bottom {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .pat-charts-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 1fr;
    }
}

.pat-charts-top .box,
.pat-charts-bottom .box {
    min-height: 100%;
}

.pat-chart-canvas {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
}

.pat-tombamentos-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pat-tombamentos-timeline .pat-timeline-item {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 1.25rem;
}

.pat-tombamentos-timeline .pat-timeline-item:last-child {
    padding-bottom: 0;
}

.pat-tombamentos-timeline .pat-timeline-item::before {
    content: "";
    position: absolute;
    left: 0.9375rem;
    top: 2rem;
    bottom: 0;
    width: 0;
    border-left: 1px dashed rgba(var(--color-primary-rgb), 0.35);
}

.pat-tombamentos-timeline .pat-timeline-item:last-child::before {
    display: none;
}

.pat-tombamentos-timeline .pat-timeline-icon {
    position: absolute;
    left: 0;
    top: 0.125rem;
    z-index: 1;
    display: flex;
    height: 2rem;
    width: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: #fff;
}

.dark .pat-tombamentos-timeline .pat-timeline-icon {
    background-color: rgb(var(--dark-bg));
}

/* Select2 custom dropdown scrollbar */
.select2-options-list {
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: #b8bec8 #f3f4f6;
}

.select2-options-list::-webkit-scrollbar {
    width: 12px;
}

.select2-options-list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-left: 1px solid #e5e7eb;
    border-radius: 0;
}

.select2-options-list::-webkit-scrollbar-thumb {
    background: #b8bec8;
    border: 2px solid #f3f4f6;
    border-radius: 9999px;
}

.select2-options-list::-webkit-scrollbar-thumb:hover {
    background: #9aa3af;
}

/* Select2 — mesma altura dos filtros (h-10 / ti-form-input) */
.select2-field-trigger {
    min-height: 2.5rem;
    height: 2.5rem;
}

.list-toolbar-search {
    height: 2.5rem;
    min-height: 2.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.list-toolbar-columns-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Cadastros auxiliares e classificação: botão e interruptores de colunas mais escuros */
.catalog-columns-btn {
    border: 1px solid #64748b !important;
    background-color: #fff !important;
    color: #1e293b !important;
    font-weight: 600;
}

.catalog-columns-btn:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #334155 !important;
}

.catalog-col-switch.ti-switch {
    background-color: #64748b;
}

.catalog-col-switch.ti-switch:checked {
    background-color: rgb(var(--color-primary));
}

.catalog-col-switch.ti-switch::before,
.catalog-col-switch.ti-switch:checked::before {
    background-color: #fff;
}

/* Correção de alinhamento vertical dos ícones de busca */
.relative > i.ri-search-line.absolute {
    position: absolute !important;
    top: 50% !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 1.25rem !important;
    width: 1.25rem !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.relative > .absolute.inset-y-0.left-0 {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    top: 0 !important;
    bottom: 0 !important;
}

/* ==========================================
   Sidebar Custom Hover & Active Design (i-PATRIAL)
   ========================================== */

/* ==========================================
   Sidebar Green Theme (i-PATRIAL)
   ========================================== */

/* Background do Sidebar - Verde do Tema */
.app-sidebar,
.app-sidebar .main-sidebar,
[data-menu-styles="color"] .app-sidebar {
    background-color: var(--patrial-primary, #044e39) !important;
}

/* Largura mínima do Sidebar (287px) e alinhamento do conteúdo principal */
@media (min-width: 992px) {
    /* Estado Aberto (Padrão) */
    html:not([toggled="icon-overlay-close"]) .app-sidebar {
        width: 287px !important;
        min-width: 287px !important;
    }

    html:not([toggled="icon-overlay-close"])[dir="ltr"] .header {
        padding-left: 287px !important;
    }

    html:not([toggled="icon-overlay-close"])[dir="ltr"] .content {
        margin-left: 287px !important;
        width: calc(100% - 287px) !important;
    }

    html:not([toggled="icon-overlay-close"])[dir="ltr"] .content .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Estado Recolhido (Collapse) */
    html[toggled="icon-overlay-close"] .app-sidebar:not([icon-overlay="open"]) {
        width: 6rem !important;
        min-width: 6rem !important;
    }

    html[toggled="icon-overlay-close"][dir="ltr"] .header {
        padding-left: 6rem !important;
    }

    html[toggled="icon-overlay-close"][dir="ltr"] .content {
        margin-left: 6rem !important;
        width: calc(100% - 6rem) !important;
    }

    html[toggled="icon-overlay-close"][dir="ltr"] .content .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}


/* ==========================================
   Header & Sidebar Collapse Button Alignment
   ========================================== */

/* Garante que o header e a logo da sidebar fiquem 100% alinhados na mesma altura (64px) */
.header {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.header .main-header {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.header .header-content {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

.header .header-left {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

.app-sidebar .main-sidebar-header {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
}

/* Botão de colapse (.sidebar-toggle) alinhado e sem ultrapassar a altura */
.header .sidebar-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.25rem !important;  /* 36px */
    height: 2.25rem !important; /* 36px */
    min-width: 2.25rem !important;
    min-height: 2.25rem !important;
    max-width: 2.25rem !important;
    max-height: 2.25rem !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 9999px !important;
    color: #4b5563 !important;
    background-color: transparent !important;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
}

.header .sidebar-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #111827 !important;
}

.header .sidebar-toggle i,
.header .sidebar-toggle .header-icon {
    font-size: 1.5rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s ease !important;
}

/* Rotaciona suavemente o ícone quando recolhido */
[toggled="icon-overlay-close"] .header .sidebar-toggle i,
[toggled="close"] .header .sidebar-toggle i {
    transform: rotate(180deg) !important;
}

.side-menu__item {
    /* max-width: 250px; */
}

.main-menu {
    /* padding-left: 1.5rem; */
    /* padding-right: 1.5rem; */
}




