/* Força ícone do GitHub branco no popover de créditos */
.popover .bi-github {
    color: #fff !important;
    fill: #fff !important;
}
/* Popover de créditos: largura dobrada e sem scroll horizontal */
.popover {
    max-width: 1920px;
    width: 40vw !important;
    min-width: 0;
    overflow-x: hidden !important;
    box-sizing: border-box;
    max-width: 100vw;
    height: fit-content;
    max-height: 95vh;
    overflow-y: hidden !important;
    margin: 0;
    padding: 0;
}
.popover .popover-body {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    padding: 12px 16px;
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}
.popover.popover-dark .popover-body {
    background-color: #495057;
    color: #e9ecef;
}
body.login-page {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem; /* Adiciona um espaçamento interno */
}

.login-logo {
    width: 250px; /* Largura idêntica ao login-card */
    height: auto; /* Mantém as proporções */
    max-width: 100%; /* Garante que não ultrapasse a largura do card */
}

.btn-login {
    background-color: #076633 !important;
    border-color: #076633 !important;
}

.btn-login:hover {
    background-color: #065529 !important;
    border-color: #065529 !important;
}

/* Estilos para a aba de créditos - centralização absoluta do logo no rodapé */

.credits-tab {
    position: relative;
    left: 0;
    bottom: 0;
    margin: 0 auto 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: 100vw;
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    padding: 0;
    opacity: 0.85;
}

.credits-tab:hover {
    transform: scale(1.08);
    opacity: 1;
}

.credits-logo {
    display: block;
    margin: 0 auto;
    width: 180px;
    max-width: 22vw;
    min-width: 40px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Estilos para o popover de créditos */
.popover.credits-popover {
    max-width: 320px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.popover.credits-popover .popover-header {
    background: linear-gradient(135deg, #076633 0%, #0a8c47 100%);
    color: #fff;
    padding: 10px 14px;
    font-size: 0.85rem;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popover.credits-popover .popover-header::before {
    content: '';
    display: none;
}

.popover.credits-popover .popover-body {
    padding: 12px;
    background: linear-gradient(180deg, #1a1d21 0%, #2b3035 100%);
    color: #e9ecef;
}

.credits-dev-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.credits-dev-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.credits-dev-item:last-child {
    margin-bottom: 0;
}

.credits-dev-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #076633, #ffc107);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.65rem;
    color: #fff;
    flex-shrink: 0;
}

.credits-dev-info {
    flex: 1;
    min-width: 0;
}

.credits-dev-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.credits-dev-role {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 1px;
}

.credits-dev-item a {
    color: #86b7fe;
    text-decoration: none;
    transition: color 0.2s ease;
}

.credits-dev-item a:hover {
    color: #ffc107;
}

.credits-org {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.credits-org-subtitle {
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.credits-org-name {
    font-weight: 700;
    color: #fff;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #076633, #0a8c47);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.credits-version {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(7, 102, 51, 0.2);
    color: #c6cec9;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* Estilos para o tooltip personalizado */
.tooltip-inner {
    max-width: 400px;
    text-align: left;
    padding: 15px;
    background-color: #2b3035;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-inner a {
    color: #86b7fe;
    text-decoration: none;
}

.tooltip-inner a:hover {
    color: #a7c7ff;
    text-decoration: underline;
}

.tooltip-inner strong {
    color: #fff;
}

.bi-cash {
    margin-right: 5px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#arrecadacao-table {
    margin-bottom: 0;
}

#arrecadacao-table th,
#arrecadacao-table td {
    white-space: nowrap;
    min-width: 120px;
    padding: 8px;
}

/* Sticky first column */
#arrecadacao-table th:first-child,
#arrecadacao-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}

/* Light theme styles */
[data-bs-theme="light"] #arrecadacao-table {
    background-color: #fff;
    color: #212529;
}

[data-bs-theme="light"] #arrecadacao-table thead th,
[data-bs-theme="light"] #arrecadacao-table tfoot td {
    background-color: #e9ecef;
}

[data-bs-theme="light"] #arrecadacao-table th:first-child,
[data-bs-theme="light"] #arrecadacao-table td:first-child {
    background-color: #e9ecef;
}

/* Dark theme styles */
[data-bs-theme="dark"] #arrecadacao-table {
    background-color: #212529;
    color: #dee2e6;
}

[data-bs-theme="dark"] #arrecadacao-table thead th,
[data-bs-theme="dark"] #arrecadacao-table tfoot td {
    background-color: #343a40;
    color: #dee2e6;
}

[data-bs-theme="dark"] #arrecadacao-table tbody td {
    background-color: #212529;
}

[data-bs-theme="dark"] #arrecadacao-table th:first-child,
[data-bs-theme="dark"] #arrecadacao-table td:first-child {
    background-color: #343a40;
    color: #dee2e6;
}

/* Text alignment */
#arrecadacao-table thead th { text-align: center; }
#arrecadacao-table tbody td:not(:first-child) { text-align: right; }
#arrecadacao-table tfoot td:not(:first-child) { text-align: right; }

/* Button styles */
.btn-arrecadacao {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

[data-bs-theme="dark"] .btn-arrecadacao {
    background-color: #343a40 !important;
    border-color: #495057 !important;
    color: #dee2e6 !important;
}

/* Form controls in dark mode */
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control {
    background-color: #212529;
    color: #dee2e6;
    border-color: #495057;
}

[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Dark theme support for month input */
[data-bs-theme="dark"] input[type="month"] {
    background-color: #343a40;
    color: #fff;
    border-color: #6c757d;
}

/* Devoluções: transformar botões outline em aparência preenchida (mantém classes existentes) */
#devolucoes-table .btn-outline-warning {
    color: #212529 !important;
    background-color: #ffc107 !important; /* warning filled */
    border-color: #ffc107 !important;
}
#devolucoes-table .btn-outline-warning:hover {
    color: #212529 !important;
    background-color: #e0a800 !important;
    border-color: #d39e00 !important;
}
#devolucoes-table .btn-outline-secondary {
    color: #fff !important;
    background-color: #6c757d !important; /* secondary filled */
    border-color: #6c757d !important;
}
#devolucoes-table .btn-outline-secondary:hover {
    color: #fff !important;
    background-color: #5c636a !important;
    border-color: #545b62 !important;
}

/* Força o badge de situação centralizado e texto acima do badge */
#devolucoes-table td .situacao-text { 
    display: block; 
    font-size: 0.95rem; 
    color: inherit; 
}
#devolucoes-table td .situacao-badge { 
    display: flex; 
    justify-content: center; 
}

/* Ensure situacao text and badge are centered */
#devolucoes-table td .situacao-text { text-align: center; }

/* Highlight rows with overdue prazo_verificacao */
.devolucao-vencido {
    background-color: rgba(220, 53, 69, 0.04) !important;
    border-left: 4px solid #dc3545;
}
.devolucao-vencido td { padding-left: 0.75rem !important; }

/* Highlight rows with situacao FEITO in green (similar style to vencido) */
.devolucao-feito {
    background-color: rgba(25, 135, 84, 0.04) !important; /* bootstrap success 25 */
    border-left: 4px solid #198754;
}
.devolucao-feito td { padding-left: 0.75rem !important; }

/* Highlight rows with situacao AGUARDANDO in yellow when not overdue */
.devolucao-aguardando {
    background-color: rgba(255, 193, 7, 0.04) !important; /* subtle yellow */
    border-left: 4px solid #ffc107;
}
.devolucao-aguardando td { padding-left: 0.75rem !important; }

/* Prevent action buttons from wrapping and keep them compact */
#devolucoes-table td.col-acoes .btn {
    white-space: nowrap;
    padding: .25rem .5rem;
    font-size: .85rem;
}
/* Ajuste para tema escuro */
[data-bs-theme="dark"] .tooltip-inner {
    background-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .tooltip-inner a {
    color: #86b7fe;
}

[data-bs-theme="dark"] .tooltip-inner a:hover {
    color: #a7c7ff;
}

/* Light theme styles */
[data-bs-theme="light"] #arrecadacao-table th:first-child,
[data-bs-theme="light"] #arrecadacao-table td:first-child {
    background-color: #e9ecef;
}

/* Dark theme styles */
[data-bs-theme="dark"] #arrecadacao-table th:first-child,
[data-bs-theme="dark"] #arrecadacao-table td:first-child {
    background-color: #343a40;
    color: #dee2e6;
}

/* Table text styles */
#arrecadacao-table th:first-child,
#arrecadacao-table td:first-child {
    text-wrap: nowrap;
}