.marginheader {
    margin-top: 0;
    padding-top: 0.35rem;
}

.page-main-content {
    padding-top: 0.75rem;
    padding-bottom: 1.5rem;
}

/* Fundo cinza suave em todo o app — destaca cards e campos brancos */
body.d-flex.min-vh-100 {
    background-color: #e5e7eb;
}

body.d-flex.min-vh-100 > .container-fluid.marginheader,
body.d-flex.min-vh-100 > .container-fluid.marginheader .col.py-3,
body.d-flex.min-vh-100 .page-main-content {
    background-color: transparent;
}

/* Contorno padrão dos campos (alinha date/text com selects) */
:root {
    --sgp-field-border: #ced4da;
    --sgp-field-border-focus: #86b7fe;
    --sgp-field-shadow-focus: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

input.form-control[type="date"],
input.form-control[type="datetime-local"],
input.form-control[type="time"],
input.form-control[type="month"],
input.form-control[type="week"],
input.modern-input[type="date"],
input.modern-input[type="datetime-local"],
input.modern-input[type="time"],
input.modern-input[type="text"],
input.modern-input[type="number"],
input.modern-input[type="email"],
input.modern-input[type="search"],
input.modern-input:not([type]),
textarea.modern-input,
select.modern-input.form-select {
    border: 1px solid var(--sgp-field-border) !important;
    background-color: #ffffff !important;
}

input.form-control[type="date"]:focus,
input.form-control[type="datetime-local"]:focus,
input.form-control[type="time"]:focus,
input.modern-input:focus,
textarea.modern-input:focus,
select.modern-input.form-select:focus {
    border-color: var(--sgp-field-border-focus) !important;
    box-shadow: var(--sgp-field-shadow-focus) !important;
}


@media (max-width: 768px) {
    .page-main-content {
        padding-top: 0.5rem;
    }
}

#cropModal .modal-dialog {
    max-width: 90%;
    margin: 1.75rem auto;
}

#cropModal .modal-body {
    padding: 0;
    overflow: hidden;
    background-color: #f0f0f0;
    position: relative;
    /* Altura fixa calculada pelo viewport, evitando reflows que causam
       flickering no mobile quando o Cropper recalcula dimensões. */
    height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#cropModal .modal-header,
#cropModal .modal-footer {
    position: relative;
    z-index: 10;
    background: #fff;
}

#cropModal.is-crop-loading #cropImage,
#cropModal.is-crop-loading .cropper-container {
    opacity: 0;
    visibility: hidden;
}

.crop-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: rgba(240, 240, 240, 0.96);
}

.crop-loading-overlay[hidden] {
    display: none !important;
}

.crop-loading-text {
    font-size: 0.95rem;
    color: #444;
}

#cropImage {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.cropper-container {
    max-height: 100% !important;
    max-width: 100% !important;
}

/*Estilos para alterar cor do campo status em Exchanges - Create e Update*/
.status-returned { background-color: #45a05a; }
.status-overdue { background-color: #e23b3b; }
.status-borrowed { background-color: #dbbf64; }


/* ===== IDENTIDADE VISUAL / LOGOS ===== */

/* Logo institucional reutilizável em telas públicas como login e recuperação de senha */
.diocese-gru-logo {
    display: block;
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin: 0 auto 0.85rem auto;
}

/* Variação menor para contextos compactos, se necessário */
.diocese-gru-logo--sm {
    width: 145px;
    height: 145px;
}

/* Variação maior para telas institucionais, se necessário */
.diocese-gru-logo--lg {
    width: 210px;
    height: 210px;
}

@media (max-width: 576px) {
    .diocese-gru-logo {
        width: 165px;
        height: 165px;
    }

    .diocese-gru-logo--sm {
        width: 135px;
        height: 135px;
    }

    .diocese-gru-logo--lg {
        width: 190px;
        height: 190px;
    }
}


/* ===== DASHBOARD MODERNO ===== */

/* Cards Modernos */
.modern-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 20px !important;
    border: none !important;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
}

/* Garante que o footer dos cards tenha z-index alto */
.modern-card .modern-card-footer {
    position: relative;
    z-index: 100;
}

.modern-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2) !important;
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Permite cliques através do overlay */
    z-index: 1;
}

.modern-card:hover::before {
    opacity: 1;
}

/* Gradientes modernos */
.gradient-churches {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.gradient-sectors {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    position: relative;
}

.gradient-items {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    position: relative;
}

.gradient-loans {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    position: relative;
}

/* Ícones modernos */
.modern-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modern-card:hover .modern-icon-wrapper {
    transform: scale(1.1) rotate(10deg);
    background: rgba(255, 255, 255, 0.3);
}

.modern-icon-wrapper svg {
    width: 32px;
    height: 32px;
    color: #fff;
    stroke: #fff;
}

/* Números destacados */
.modern-number {
    font-size: 3rem !important;
    font-weight: 800 !important;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Texto moderno */
.modern-title {
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem !important;
    opacity: 0.95;
}

.modern-subtitle {
    font-size: 0.85rem !important;
    opacity: 0.8;
    font-weight: 500 !important;
}

/* Indicadores de tendência */
.trend-indicator {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    margin-top: 0.5rem;
    display: inline-block;
}

/* Animações de entrada */
.animate-card {
    animation: slideInUp 0.6s ease-out;
}

.animate-card:nth-child(2) { animation-delay: 0.1s; }
.animate-card:nth-child(3) { animation-delay: 0.2s; }
.animate-card:nth-child(4) { animation-delay: 0.3s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Seção de gráficos moderna */
.modern-chart-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    border: none !important;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.modern-chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Títulos modernos para todas as páginas */
.modern-page-title {
    background: linear-gradient(135deg, #23337a 0%, #063683 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700 !important;
    font-size: 2rem !important;
    margin-bottom: 1.5rem !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modern-page-title i,
.modern-page-title svg {
    color: rgb(6, 6, 109) !important;
    -webkit-text-fill-color: rgb(6, 6, 109) !important;
    stroke: rgb(6, 6, 109);
    fill: none;
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
}

/* Subtítulos modernos */
.modern-subtitle {
    color: #6c757d !important;
    font-weight: 500 !important;
    font-size: 1.1rem !important;
    margin-bottom: 1rem !important;
}

/* Seletor de Igreja Moderno */
.modern-church-selector {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.2);
}

.modern-select-wrapper {
    position: relative;
}

.modern-select {
    border-radius: 12px !important;
    border: 2px solid #e9ecef !important;
    padding: 0.75rem 1rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    background: white !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.modern-select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
    transform: translateY(-2px);
}

.modern-select:hover {
    border-color: #667eea !important;
    transform: translateY(-1px);
}

.select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6c757d;
    transition: all 0.3s ease;
}

.modern-select:focus + .select-icon {
    color: #667eea;
    transform: translateY(-50%) rotate(180deg);
}

/* Modais Modernos */
.modern-modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    height: 95vh !important;
    margin: 2.5vh auto !important;
}

.modern-modal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25) !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modern-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #0d6efd 100%);
    color: white !important;
    border: none !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 1.5rem 2rem !important;
}

.modern-modal .modal-title {
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    margin: 0 !important;
}

.modern-modal .btn-close {
    background: rgba(220, 53, 69, 0.9) !important; /* Fundo vermelho */
    border: 2px solid rgba(255,255,255,0.4) !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    width: 40px !important;
    height: 40px !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

.modern-modal .btn-close:hover {
    background: rgba(220, 53, 69, 1) !important; /* Vermelho sólido no hover */
    border-color: rgba(255,255,255,0.6) !important;
    transform: scale(1.15) !important;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5) !important;
}

.modern-modal .btn-close::before {
    content: '×' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: white !important;
    font-size: 20px !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

/* Remove o ícone padrão do Bootstrap */
.modern-modal .btn-close:not(:disabled):not(.disabled) {
    background-image: none !important;
}

.modern-modal .modal-body {
    padding: 1.5rem 2rem 2rem 2rem !important; /* Menos padding no topo */
    flex: 1 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.modern-modal .modal-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none !important;
    border-radius: 0 0 20px 20px !important;
    padding: 1.5rem 2rem !important;
    gap: 1rem !important;
    overflow: visible !important;
}

#modalItemsTable .modal-header {
    padding: 0.7rem 1.15rem 0.85rem !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    overflow: visible !important;
}

#modalItemsTable .modal-title {
    font-size: 1.15rem !important;
    line-height: 1.3 !important;
    min-width: 0;
}

#modalItemsTable .items-modal-header-row .btn {
    padding: 0.3rem 0.75rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    white-space: nowrap;
}

#modalItemsTable .modal-header .btn-close {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0;
}

#modalItemsTable .modal-header .btn-close::before {
    font-size: 16px !important;
}

#modalItemsTable .items-modal-toolbar .form-label {
    color: #fff !important;
    font-size: 0.8rem;
}

#modalItemsTable .items-modal-toolbar .row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.35rem;
}

#modalItemsTable .modal-body {
    padding: 0.75rem 1.15rem 1rem !important;
}

#modalItemsTable .items-modal-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#printItemListModal {
    overflow: visible;
}

#printItemListModal .modal-content,
#printItemListModal .modal-body {
    overflow: visible;
}

.modern-modal .btn {
    border-radius: 12px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.modern-modal .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* Container dos gráficos nos modais */
.modern-modal .modal-body > div {
    flex: 1 !important;
    min-height: 0 !important; /* Permite que o flex shrink funcione */
}

/* ===== NAVBAR MODERNA ===== */

/* Navbar principal */
.app-header-stack {
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    flex: 0 0 auto;
    padding-top: env(safe-area-inset-top, 0px);
    isolation: isolate;
}

/* Navbar principal — no fluxo do documento (não fixed), para o conteúdo
   nunca ficar sob a barra mesmo se a altura mudar no celular. */
.modern-navbar {
    background: linear-gradient(135deg, #667eea 0%, #0d6efd 100%) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
    padding: 0.5rem 1rem !important;
    min-height: 56px !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    position: relative !important;
    top: auto !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.modern-navbar > .container-fluid {
    overflow: visible !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    min-height: 56px;
}

.modern-navbar .header-slot {
    flex-shrink: 0;
}

.modern-navbar .header-icons-container {
    overflow: visible !important;
    flex-wrap: nowrap !important;
    min-width: 0;
}

/* Botão do menu */
.modern-menu-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    padding: 0.5rem 1rem !important;
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.modern-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px) !important;
    color: white !important;
}

/* Ícones do header - sem background por padrão */
.modern-header-icon {
    background: transparent !important;
    border-radius: 12px !important;
    padding: 0.55rem !important;
    margin: 0 0.25rem !important;
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
    color: white !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border: 2px solid transparent !important;
    transform: none !important;
    position: relative !important;
}

.modern-header-icon:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important;
    transform: none !important;
}

.modern-header-icon.active,
.modern-header-icon.active:hover,
a.modern-header-icon.active {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
}

/* Força aplicação do estilo ativo - especificidade alta */
.modern-navbar .modern-header-icon.active {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
}

/* Badge de notificação (empréstimos atrasados) */
.nav-notify-badge {
    position: absolute !important;
    top: -2px !important;
    right: -4px !important;
    min-width: 1.25rem !important;
    height: 1.25rem !important;
    padding: 0 0.3rem !important;
    border-radius: 999px !important;
    background: #dc3545 !important;
    color: #ffffff !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    line-height: 1.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35) !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

.nav-notify-badge--sidebar {
    position: static !important;
    margin-left: auto !important;
    min-width: 1.45rem !important;
    height: 1.45rem !important;
    line-height: 1.45rem !important;
    font-size: 0.75rem !important;
    border-color: rgba(255, 255, 255, 0.85) !important;
    flex-shrink: 0 !important;
}

.modern-header-icon i,
.modern-header-icon svg {
    font-size: 1.35rem !important;
    width: 1.35rem !important;
    height: 1.35rem !important;
    stroke-width: 2;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    flex-shrink: 0;
    overflow: visible;
    vertical-align: middle !important;
}

.modern-header-icon i.bi::before {
    display: block !important;
    line-height: 1 !important;
    vertical-align: 0 !important;
    margin: 0 !important;
}

/* Dropdown do usuário */
.modern-user-dropdown .dropdown-toggle {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 25px !important;
    padding: 0.5rem 1rem !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.modern-user-dropdown .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px) !important;
    color: white !important;
}

.modern-user-dropdown .dropdown-menu {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
    padding: 0.5rem !important;
}

.modern-user-dropdown .dropdown-item {
    border-radius: 12px !important;
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 0 !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
}

.modern-user-dropdown .dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    transform: translateX(5px) !important;
}

/* Responsividade da navbar.
   Bootstrap .navbar usa flex-wrap: wrap abaixo de lg (992px), o que
   derruba o perfil para uma 2ª linha e cobre o botão "+ Novo". */
@media (max-width: 991.98px) {
    .modern-navbar .modern-header-icon.header-icon-compact-hide:not(.has-notify) {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .modern-navbar {
        padding: 0.4rem 0.5rem !important;
    }

    .modern-header-icon {
        padding: 0.45rem !important;
        min-width: 40px !important;
        min-height: 40px !important;
        margin: 0 0.1rem !important;
    }

    .modern-header-icon i,
    .modern-header-icon svg {
        font-size: 1.2rem !important;
        width: 1.2rem;
        height: 1.2rem;
    }

    .modern-menu-btn {
        padding: 0.4rem 0.65rem !important;
        font-size: 0.9rem !important;
    }

    .modern-user-dropdown .dropdown-toggle {
        padding: 0.4rem 0.65rem !important;
    }
}

/* Phones largos (S24/S25/S26 Ultra ~412–480px) e menores */
@media (max-width: 576px) {
    .modern-navbar {
        min-height: 52px !important;
        padding: 0.3rem 0.35rem !important;
        overflow: visible !important;
    }

    .modern-navbar > .container-fluid {
        min-height: 52px !important;
        overflow: visible !important;
    }

    .modern-navbar .header-icons-container {
        min-height: 0 !important;
    }

    .modern-navbar .modern-header-icon.header-icon-phone-hide {
        display: none !important;
    }

    .modern-header-icon {
        padding: 0.3rem !important;
        min-width: 36px !important;
        min-height: 36px !important;
        margin: 0 0.04rem !important;
    }

    .modern-header-icon i,
    .modern-header-icon svg {
        font-size: 1.05rem !important;
        width: 1.05rem;
        height: 1.05rem;
    }

    .modern-menu-btn {
        padding: 0.3rem 0.45rem !important;
    }

    .modern-user-dropdown {
        position: relative;
        z-index: 1055;
    }

    .modern-user-dropdown .dropdown-toggle {
        padding: 0.3rem 0.45rem !important;
    }

    .modern-user-dropdown .dropdown-menu {
        z-index: 1055 !important;
    }
}

@media (max-width: 360px) {
    .modern-header-icon {
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 0.22rem !important;
    }
}

/* ===== SIDEBAR MODERNA ===== */

/* Sidebar principal — acima dos Select2 (1020) e do header (1030) */
.modern-sidebar {
    background: linear-gradient(180deg, #667eea 0%, #0d6efd 100%) !important;
    backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15) !important;
    z-index: 1045 !important;
}

/* Header da sidebar - removido */
.modern-sidebar-header {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    position: relative !important;
    display: block !important;
    min-height: 20px !important;
    margin: 0 !important;
}

/* Botão de fechar centralizado na metade da sidebar */
.modern-sidebar-close-btn {
    position: absolute !important;
    top: 50vh !important;
    right: -15px !important;
    transform: translateY(-50%) !important;
    border-radius: 50% !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    z-index: 1001 !important;
    cursor: pointer !important;
    padding: 0 !important;
}

.modern-sidebar-close-btn:hover {
    transform: translateY(-50%) scale(1.1) !important;
}

.modern-sidebar-close-btn i {
    color: white !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.modern-sidebar-close-btn:hover i {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}


.modern-sidebar-logo {
    border-radius: 12px !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    margin-top: 0 !important;
    transition: all 0.3s ease !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
}

.modern-sidebar-logo img {
    max-width: 120px !important;
    max-height: 120px !important;
}

.modern-sidebar-logo:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Links da sidebar - background limitado */
.modern-sidebar-link {
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    margin: 0.15rem 0 !important;
    margin-right: 25px !important;
    padding: 0.5rem 0.75rem !important;
    color: white !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    position: relative !important;
}

.modern-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transform: translateX(3px) !important; /* Reduzido para não invadir */
    color: white !important;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.2) !important;
}

.modern-sidebar-link.active {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    transform: translateX(3px) !important; /* Reduzido para não invadir */
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.2) !important;
}

.modern-sidebar-link i,
.modern-sidebar-link svg {
    font-size: 1.7rem !important;
    width: 1.15em;
    height: 1.15em;
    min-width: 14px !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    flex-shrink: 0;
}

.modern-sidebar-link i.bi::before {
    display: block !important;
    line-height: 1 !important;
    vertical-align: 0 !important;
}

/* Body da sidebar - compacto sem espaço superior */
.modern-sidebar-body {
    padding: 0.5rem 0.75rem !important;
    background: transparent !important;
    overflow-y: auto !important;
    max-height: 100vh !important;
    padding-top: 0.5rem !important;
}

/* Lista de navegação - sem gaps extras */
.modern-sidebar .nav {
    gap: 0 !important;
}

/* Responsividade da sidebar */
@media (max-width: 1200px) {
    .modern-sidebar-link {
        padding: 0.45rem 0.65rem !important;
        font-size: 0.85rem !important;
    }

    .modern-sidebar-link i,
    .modern-sidebar-link svg {
        font-size: 1rem !important;
        width: 1rem;
        height: 1rem;
    }
}

@media (max-width: 768px) {
    .modern-sidebar-link {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
        margin-right: 20px !important; /* Ajustado para telas menores */
    }

    .modern-sidebar-link i,
    .modern-sidebar-link svg {
        font-size: 0.95rem !important;
        width: 0.95rem;
        height: 0.95rem;
    }

    .modern-sidebar-logo {
        padding: 0.3rem !important;
        margin-bottom: 0.4rem !important;
        margin-top: 0 !important;
        margin-right: 20px !important;
    }

    .modern-sidebar-logo img {
        max-width: 100px !important;
        max-height: 100px !important;
    }

    .modern-sidebar-body {
        padding: 0.3rem 0.5rem !important;
        padding-top: 0.3rem !important;
    }

    .modern-sidebar-close-btn {
        right: -12px !important;
    }
}

@media (max-width: 480px) {
    .modern-sidebar-link {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.75rem !important;
        margin: 0.1rem 0 !important;
        margin-right: 18px !important; /* Ajustado para mobile */
    }

    .modern-sidebar-link i,
    .modern-sidebar-link svg {
        font-size: 0.85rem !important;
        width: 0.85rem;
        height: 0.85rem;
        min-width: 18px !important;
    }

    .modern-sidebar-logo {
        padding: 0.25rem !important;
        margin-bottom: 0.3rem !important;
        margin-top: 0 !important;
        margin-right: 18px !important;
    }

    .modern-sidebar-logo img {
        max-width: 80px !important;
        max-height: 80px !important;
    }

    .modern-sidebar-body {
        padding: 0.2rem 0.4rem !important;
        padding-top: 0.2rem !important;
    }

    .modern-sidebar-close-btn {
        right: -10px !important;
    }
}

.sidebar-icon {
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.5rem;
    vertical-align: middle;
    display: inline-block;
    line-height: 1;
  }

.sidebar-icon[data-lucide] {
    width: 1em;
    height: 1em;
    margin-right: 0.5rem;
    vertical-align: middle;
    display: inline-block;
  }

.sidebar-text {
    vertical-align: middle;
    display: inline-block;
  }

/* ===== ESTILOS ESPECÍFICOS PARA PÁGINAS ===== */

/* Botões modernos */
.modern-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #0d6efd 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.modern-btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4) !important;
}

.modern-btn-action {
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.modern-btn-action:hover {
    transform: translateY(-1px) !important;
}

/* Ações: azul do header das listas + fundo branco; exclusão vermelha */
.btn.modern-btn-action.btn-outline-primary,
.btn.modern-btn-action.btn-outline-info,
.btn.modern-btn-action.btn-outline-warning,
.btn.modern-btn-action.btn-outline-secondary,
.btn.js-receipt-print,
.btn.js-receipt-pdf {
    color: #23337a !important;
    border-color: #23337a !important;
    background-color: #ffffff !important;
}

.btn.modern-btn-action.btn-outline-primary:hover,
.btn.modern-btn-action.btn-outline-primary:focus,
.btn.modern-btn-action.btn-outline-info:hover,
.btn.modern-btn-action.btn-outline-info:focus,
.btn.modern-btn-action.btn-outline-warning:hover,
.btn.modern-btn-action.btn-outline-warning:focus,
.btn.modern-btn-action.btn-outline-secondary:hover,
.btn.modern-btn-action.btn-outline-secondary:focus,
.btn.js-receipt-print:hover,
.btn.js-receipt-print:focus,
.btn.js-receipt-pdf:hover,
.btn.js-receipt-pdf:focus {
    color: #ffffff !important;
    background-color: #23337a !important;
    border-color: #23337a !important;
    box-shadow: 0 4px 12px rgba(35, 51, 122, 0.35) !important;
}

.btn.modern-btn-action.btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: #ffffff !important;
}

.btn.modern-btn-action.btn-outline-danger:hover,
.btn.modern-btn-action.btn-outline-danger:focus {
    color: #ffffff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35) !important;
}

/* Estilos específicos para botões de ação em cards */
.modern-card-footer .modern-btn-action {
    position: relative;
    z-index: 1000;
    pointer-events: auto;
}

.modern-card-footer a {
    position: relative;
    z-index: 1000;
    pointer-events: auto;
}

/* Cards modernos para páginas específicas */
.modern-card-header {
    background: linear-gradient(135deg, #667eea 0%, #0d6efd 100%) !important;
    border: none !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 1rem !important;
}

.modern-card-footer {
    background: rgba(248, 249, 250, 0.8) !important;
    border: none !important;
    border-radius: 0 0 16px 16px !important;
    padding: 1rem !important;
}

/* ===== IGREJA LIST ESPECÍFICOS ===== */

.church-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.church-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #fff;
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-left: 4px solid #0d6efd;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 40, 90, 0.12);
}

.church-card:hover,
.modern-card.church-card:hover {
    transform: none !important;
}

.church-image-container {
    flex: 0 0 260px;
    width: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    background: #f8f9fb;
    overflow: hidden;
}

.church-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 280px;
    object-fit: contain;
    object-position: center;
}

.church-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
}

.church-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.church-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: rgb(6, 6, 109);
}

.church-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.church-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: rgba(248, 249, 250, 0.8);
}

.info-item i {
    font-size: 1.1rem;
    margin-top: 0.15rem;
}

.info-item div {
    flex: 1;
    min-width: 0;
}

.users-section {
    background: rgba(248, 249, 250, 0.55);
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.section-title {
    color: #495057;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 0.4rem;
}

.users-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-badge {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .church-card {
        flex-direction: column;
    }

    .church-image-container {
        flex: none;
        width: 100%;
        height: 200px;
    }

    .church-image {
        max-height: 200px;
    }

    .church-info-grid {
        grid-template-columns: 1fr;
    }

    .church-card-top {
        flex-wrap: wrap;
    }

    .info-item {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
}

/* ===== INPUTS E FILTROS MODERNOS ===== */

/* Proporção padrão: pesquisa 7/10 · filtros secundários 3/10 */
.modern-filters > form.row > .filter-search-col {
    flex: 7 1 0% !important;
    width: auto !important;
    max-width: none;
}

.modern-filters > form.row > .filter-secondary-col {
    flex: 3 1 0% !important;
    width: auto !important;
    max-width: none;
}

@media (max-width: 767.98px) {
    .modern-filters > form.row > .filter-search-col,
    .modern-filters > form.row > .filter-secondary-col {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100%;
    }
}

.modern-input-group {
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.modern-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.modern-input {
    border: 1px solid var(--sgp-field-border) !important;
    border-radius: 0.375rem !important;
    padding: 0.75rem 1rem !important;
    font-weight: 500 !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    background: #ffffff !important;
}

.modern-input:focus {
    border-color: var(--sgp-field-border-focus) !important;
    box-shadow: var(--sgp-field-shadow-focus) !important;
    background: #ffffff !important;
}

/* Dentro de input-group o contorno fica no wrapper */
.modern-input-group .modern-input,
.input-group .modern-input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.modern-input-group .modern-input:focus,
.input-group .modern-input:focus {
    border: none !important;
    box-shadow: none !important;
}

/* ===== TABELAS MODERNAS ===== */

.table-actions-header {
    background: rgba(248, 249, 250, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.table-info {
    font-size: 1rem;
}

.table-info small,
.table-info .table-range-text,
.table-info .text-muted {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
}

.table-info--footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1rem 0.25rem;
}

.table-info i[data-lucide],
.table-info svg {
    width: 1.1rem;
    height: 1.1rem;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: -0.15em;
}

.exchange-receipt-dropdown .dropdown-menu {
    z-index: 1080;
    min-width: 14rem;
}

.exchange-receipt-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    color: #23337a;
    font-weight: 500;
    line-height: 1.25;
}

.exchange-receipt-dropdown .dropdown-item:hover,
.exchange-receipt-dropdown .dropdown-item:focus {
    background-color: rgba(35, 51, 122, 0.08);
    color: #23337a;
}

.exchange-receipt-dropdown .dropdown-item > i {
    width: 1.1rem;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    text-align: center;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-state > i,
.empty-state > svg,
.empty-state .empty-state-icon {
    display: block;
    margin-left: auto;
    margin-right: auto;
    line-height: 1;
    flex-shrink: 0;
}

.empty-state svg.lucide,
.empty-state i[data-lucide],
.empty-state .empty-state-icon {
    width: 4rem;
    height: 4rem;
    color: #6c757d;
    opacity: 0.4;
}

.icon-box i[data-lucide],
.icon-box svg {
    width: 1.75rem;
    height: 1.75rem;
    color: #fff;
    stroke: #fff;
}

/* Modern table header */
.modern-table-header {
    background: linear-gradient(135deg, #23337a 0%, #063683 100%) !important;
    border: none !important;
    position: relative !important;
}

.modern-table-header th {
    border: none !important;
    color: white !important;
    font-weight: 700 !important;
    padding: 1.25rem 1rem !important;
    text-transform: uppercase !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.5px !important;
    vertical-align: middle !important;
    background: transparent !important;
}

.modern-table-header th a {
    color: white !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
}

.modern-table-header th a:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-1px) !important;
}

.modern-table-header th i {
    color: white !important;
}

/* Modern table container */
.modern-table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Modern table */
.modern-table {
    margin-bottom: 0 !important;
    border: none !important;
}

/* Hover das linhas: só fundo, sem translate (evita sumir as bordas) */
.hover-row,
.modern-table tbody tr.hover-row {
    transform: none !important;
    transition: background-color 0.15s ease !important;
}

.hover-row:hover,
.modern-table tbody tr.hover-row:hover {
    background-color: #f1f3f5 !important;
    transform: none !important;
}

.hover-row.history-row-entrada:hover,
.hover-row.exchange-row-devolvido:hover {
    background-color: #e9ecef !important;
    transform: none !important;
}

.hover-row.history-row-saida:hover,
.hover-row.exchange-row-atrasado:hover {
    background-color: #e9ecef !important;
    transform: none !important;
}

.hover-row.exchange-row-emprestado:hover {
    background-color: #e9ecef !important;
    transform: none !important;
}

.hover-row.item-row-emprestado:hover,
.hover-row.item-row-emprestado:hover > td,
.modern-table tbody tr.item-row-emprestado:hover > td {
    background-color: rgba(255, 193, 7, 0.16) !important;
    --bs-table-bg: rgba(255, 193, 7, 0.16) !important;
    --bs-table-bg-state: rgba(255, 193, 7, 0.16) !important;
    transform: none !important;
}

.hover-row.item-row-atrasado:hover,
.hover-row.item-row-atrasado:hover > td,
.modern-table tbody tr.item-row-atrasado:hover > td {
    background-color: rgba(220, 53, 69, 0.14) !important;
    --bs-table-bg: rgba(220, 53, 69, 0.14) !important;
    --bs-table-bg-state: rgba(220, 53, 69, 0.14) !important;
    transform: none !important;
}

.bulk-actions {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVIDADE GERAL ===== */

@media (max-width: 768px) {
    .modern-filters {
        padding: 1rem !important;
    }

    .table-actions-header .d-flex {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: flex-start !important;
    }

    .bulk-actions {
        width: 100%;
    }
}

/* ===== ITEM LIST ESPECÍFICOS ===== */

/* Container de foto do item */
.item-photo-container {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.item-photo-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.item-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
}

.item-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    font-size: 1.5rem;
}

.item-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.2rem;
}

.item-photo-container:hover .item-photo {
    transform: scale(1.1);
}

.item-photo-container:hover .item-photo-overlay {
    opacity: 1;
}

/* Status badges */
.status-badge {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    font-weight: 500 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-badge svg,
.status-badge i[data-lucide] {
    width: 0.9em;
    height: 0.9em;
    flex-shrink: 0;
}

/* Quantity + loan status stack */
.quantity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
}

.quantity-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    margin: 0 auto;
}

.quantity-cell .item-loan-status-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 2.75rem;
    height: auto !important;
    padding: 0.35rem 0.7rem !important;
    border: none !important;
    border-radius: 999px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
    transform: none !important;
}

.quantity-cell .item-loan-status-btn:hover {
    transform: translateY(-1px) !important;
}

.quantity-cell .item-loan-status-qty {
    color: #ffffff;
    line-height: 1;
}

.quantity-cell .item-loan-status-btn i {
    font-size: 0.9rem;
    line-height: 1;
}

/* Responsividade para item list */
@media (max-width: 768px) {
    .item-photo-container {
        width: 60px;
        height: 60px;
    }

    .status-badge {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
    }
}

/* ===== SECTOR LIST ESPECÍFICOS ===== */

/* Estatísticas do setor */
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(248, 249, 250, 0.5);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(248, 249, 250, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-item i {
    font-size: 1.2rem;
}

/* Barra de ações flutuante */
.floating-actions-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #23337a 0%, #063683 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(35, 51, 122, 0.4);
    z-index: 1000;
    animation: slideUp 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Cards de setor específicos */
.sector-card {
    border: 1px solid rgba(35, 51, 122, 0.1);
    transition: all 0.3s ease;
}

.sector-card:hover {
    border-color: rgba(35, 51, 122, 0.3);
    box-shadow: 0 8px 25px rgba(35, 51, 122, 0.15);
}

.church-info {
    background: rgba(35, 51, 122, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

/* Responsividade para barra flutuante */
@media (max-width: 768px) {
    .floating-actions-bar {
        left: 10px;
        right: 10px;
        transform: none;
        padding: 0.75rem 1rem;
        border-radius: 16px;
    }

    .floating-actions-bar .d-flex {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: center !important;
    }
}

/* ===== FILTROS AVANÇADOS ===== */

/* Transição suave para filtros avançados */
.advanced-filters {
    animation: slideDown 0.3s ease-in-out;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

/* Estilo para o card de filtros avançados */
.advanced-filters .card {
    border: 1px solid rgba(35, 51, 122, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    background: #ffffff;
}

.advanced-filters .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.advanced-filters .card-body {
    background: #ffffff;
    border-radius: 8px;
}

.advanced-filters .card.bg-light,
.modern-filters .card.bg-light {
    background-color: #ffffff !important;
}

.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    border: 1px solid var(--sgp-field-border) !important;
    background-color: #ffffff !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--sgp-field-border-focus) !important;
    box-shadow: var(--sgp-field-shadow-focus) !important;
}

.form-select-lg + .select2-container--bootstrap-5 .select2-selection {
    min-height: 48px;
    font-size: 1.25rem;
}

.select2-container--bootstrap-5.select2-container--disabled .select2-selection {
    background-color: #e9ecef;
}

/* ===== HISTORY LIST ESPECÍFICOS ===== */

/* Container de foto do histórico */
.history-photo-container {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.history-photo-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.history-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
}

.history-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    font-size: 1.2rem;
}

.history-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    color: white;
    font-size: 1rem;
}

.history-photo-container:hover .history-photo {
    transform: scale(1.1);
}

.history-photo-container:hover .history-photo-overlay {
    opacity: 1;
}

/* Responsividade para history list */
@media (max-width: 768px) {
    .history-photo-container {
        width: 50px;
        height: 50px;
    }
}

/* ===== EXCHANGE LIST ESPECÍFICOS ===== */

/* Container de foto dos empréstimos */
.exchange-photo-container {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.exchange-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
}

.exchange-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    font-size: 1.2rem;
}

.exchange-photo-container:hover .exchange-photo {
    transform: scale(1.05);
}

.item-location-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem 0.75rem;
    margin-top: 0.15rem;
}

.item-location-meta svg.lucide,
.item-location-meta i[data-lucide],
.item-location-meta i.bi {
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: -0.15em;
}

.exchange-destination-col {
    min-width: 180px;
    max-width: 240px;
}

.exchange-destination-name {
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.exchange-responsible-name,
.exchange-receiver-name {
    min-width: 0;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.exchange-responsible-col,
.exchange-receiver-col {
    min-width: 80px;
    max-width: 100px;
    width: 95px;
}

/* Responsividade para exchange list */
@media (max-width: 768px) {
    .exchange-photo-container {
        width: 50px;
        height: 50px;
    }
}

/* ===== FOOTER MODERNO E MINIMALISTA ===== */

.modern-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid rgba(35, 51, 122, 0.1);
    padding: 1rem 0;
    margin-top: auto;
    position: relative;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 100%;
    min-height: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    height: 24px;
    width: auto;
    opacity: 0.9;
}

.footer-copyright {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.footer-link:hover {
    color: #23337a;
    text-decoration: none;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #23337a;
    transition: width 0.2s ease;
}

.footer-link:hover::after {
    width: 100%;
}

.footer-support {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366 !important;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.footer-support:hover {
    background: rgba(37, 211, 102, 0.15);
    color: #128c7e !important;
    border-color: rgba(37, 211, 102, 0.3);
    transform: translateY(-1px);
}

.footer-support::after {
    display: none;
}

/* Créditos discretos */
.footer-credits {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.footer-credits:hover {
    opacity: 0.8;
}

.credits-text {
    font-size: 0.75rem;
    color: #81858a;
    font-weight: 400;
}

.credits-logo {
    height: 12px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.footer-credits:hover .credits-logo {
    opacity: 1;
}

/* Responsividade */
@media (max-width: 768px) {
    .modern-footer {
        padding: 0.75rem 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        min-height: auto;
    }

    .footer-links {
        justify-content: center;
        gap: 1rem;
        order: 1;
    }

    .footer-brand {
        order: 2;
    }

    .footer-credits {
        justify-content: center;
        order: 3;
    }

    .footer-link {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .footer-links {
        gap: 0.75rem;
    }

    .footer-support {
        padding: 0.25rem 0.75rem;
    }

    .footer-logo {
        height: 20px;
    }

    .credits-logo {
        height: 14px;
    }
}

/* ===== CORES DE FUNDO PARA LINHAS DAS TABELAS ===== */

/* Reset de estilos Bootstrap para garantir nossas cores customizadas */
.modern-table tbody tr,
.table tbody tr {
    background-color: transparent !important;
}

/* Force override para qualquer classe Bootstrap */
.table-success,
.table-danger,
.table-warning,
.table-info,
.table-light,
.table-secondary {
    background-color: transparent !important;
}

/* Histórico de Movimentações - cores para entrada/saída */
.history-row-entrada,
tr.history-row-entrada,
.modern-table .history-row-entrada,
.modern-table tbody .history-row-entrada,
.table .history-row-entrada {
    background-color: rgba(25, 135, 84, 0.15) !important; /* Verde claro mais visível */
}

.history-row-saida,
tr.history-row-saida,
.modern-table .history-row-saida,
.modern-table tbody .history-row-saida,
.table .history-row-saida {
    background-color: rgba(220, 53, 69, 0.15) !important; /* Vermelho claro mais visível */
}

/* Empréstimos - cores para status */
.exchange-row-devolvido,
tr.exchange-row-devolvido,
.modern-table .exchange-row-devolvido,
.modern-table tbody .exchange-row-devolvido,
.table .exchange-row-devolvido {
    background-color: rgba(25, 135, 84, 0.15) !important; /* Verde claro mais visível */
}

.exchange-row-emprestado,
tr.exchange-row-emprestado,
.modern-table .exchange-row-emprestado,
.modern-table tbody .exchange-row-emprestado,
.table .exchange-row-emprestado {
    background-color: rgba(255, 193, 7, 0.08) !important;
}

.exchange-row-atrasado,
tr.exchange-row-atrasado,
.modern-table .exchange-row-atrasado,
.modern-table tbody .exchange-row-atrasado,
.table .exchange-row-atrasado {
    background-color: rgba(220, 53, 69, 0.08) !important;
}

/* Lista de itens — destaque por status de empréstimo */
.item-row-emprestado,
tr.item-row-emprestado,
.modern-table .item-row-emprestado,
.modern-table tbody .item-row-emprestado,
.table .item-row-emprestado,
.item-row-emprestado > td,
.modern-table tbody tr.item-row-emprestado > td,
.table tbody tr.item-row-emprestado > td {
    background-color: rgba(255, 193, 7, 0.10) !important;
    --bs-table-bg: rgba(255, 193, 7, 0.10) !important;
    --bs-table-bg-type: rgba(255, 193, 7, 0.10) !important;
    --bs-table-bg-state: rgba(255, 193, 7, 0.10) !important;
}

.item-row-atrasado,
tr.item-row-atrasado,
.modern-table .item-row-atrasado,
.modern-table tbody .item-row-atrasado,
.table .item-row-atrasado,
.item-row-atrasado > td,
.modern-table tbody tr.item-row-atrasado > td,
.table tbody tr.item-row-atrasado > td {
    background-color: rgba(220, 53, 69, 0.08) !important;
    --bs-table-bg: rgba(220, 53, 69, 0.08) !important;
    --bs-table-bg-type: rgba(220, 53, 69, 0.08) !important;
    --bs-table-bg-state: rgba(220, 53, 69, 0.08) !important;
}

.item-loan-status-btn {
    border: none !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
    color: #ffffff !important;
}

.item-loan-status-btn i,
.item-loan-status-btn i::before {
    color: #ffffff !important;
}

.item-loan-status-btn--emprestado,
.item-loan-status-btn--emprestado:hover,
.item-loan-status-btn--emprestado:focus,
.item-loan-status-btn--emprestado:active {
    background-color: #fd7e14 !important;
    border-color: #fd7e14 !important;
    color: #ffffff !important;
}

.item-loan-status-btn--atrasado,
.item-loan-status-btn--atrasado:hover,
.item-loan-status-btn--atrasado:focus,
.item-loan-status-btn--atrasado:active {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

/* Overlay de carregamento em submits longos (ex.: criar usuário) */
.form-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.form-loading-overlay[hidden] {
    display: none !important;
}

.form-loading-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    min-width: min(320px, 90vw);
}

.form-loading-text {
    margin-top: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.form-loading-hint {
    margin-top: 0.35rem;
    font-size: 0.875rem;
}

.select2-container {
    z-index: 1 !important;
}

.select2-container--open {
    z-index: 1 !important;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.form-label svg.lucide,
.form-label i[data-lucide] {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

.btn svg.lucide,
.btn i[data-lucide] {
    width: 1em;
    height: 1em;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: -0.125em;
}

.select2-dropdown.select2-dropdown--below,
.select2-dropdown.select2-dropdown--above {
    display: flex;
    flex-direction: column;
}

.select2-filter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    flex: 0 0 auto;
}

.select2-filter-footer .select2-filter-apply {
    min-width: 7.5rem;
}

.select2-dropdown,
.select2-container--open .select2-dropdown {
    z-index: 1020 !important;
}

.modal .select2-container,
.modal .select2-container--open {
    z-index: 1065 !important;
}

.modal .select2-dropdown,
.modal .select2-container--open .select2-dropdown {
    z-index: 1070 !important;
}

.select-option-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.select2-container--bootstrap-5 .select2-results__group,
.select-option-church-group {
    color: #111 !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
}

.select2-selection__rendered .select-option-with-icon {
    max-width: 100%;
    flex-wrap: nowrap;
}

.select-option-with-icon .select-option-icon,
.select-option-with-icon svg.select-option-icon,
.select-option-with-icon i[data-lucide],
.select-option-with-icon svg[data-lucide] {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.select-option-with-icon .bi {
    font-size: 1rem;
    line-height: 1;
}

.modern-select-wrapper:has(.select2-container) .select-icon {
    display: none;
}

body.form-loading-active {
    overflow: hidden;
}
