:root {
    --primary: #6883A5;
    --primary-dark: #455A86;
    --header-height: 70px;
    --sidebar-width: 250px;
    --sidebar-collapsed: 0px;
    --bs-primary: #6883A5;
    --bs-primary-rgb: 104, 131, 165;
}

/* HEADER */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: #fff;
    z-index: 1030;
}
.brand-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.brand-title {
    font-size: 28px;
    font-weight: bold;
}
.brand-title-mobile {
    display: none;
    font-size: 30px;
    font-weight: bold;
}
.brand-sub {
    font-size: 14px;
    color: #dce6f9;
    margin-top: 0px;
}
#toggleMenuHeader {
    margin-right: 15px;
    cursor: pointer;
}
.btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
}
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #fff;
}
.btn-outline-light i {
    font-size: 1.1rem;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}
 
.btn-outline-primary:hover {
	background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.iframe-buscar-funcao{
    width:260px; 
    height:36px; 
    border:none; 
    background:transparent; 
    display:block; 
    /* vertical-align:middle; */
}
.buscar-funcao-mobile{
    width:100%; 
    height:36px; 
    border:none; 
    background:transparent; 
    vertical-align:middle;
}

/* Form Search */
form.search-form {
    background-color: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 6px;
    padding: 0 0.5rem;
    height: 36px;
    min-width: 260px;
    display: flex !important;
    align-items: center;
    box-shadow: none;
}
form.search-form input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 0;
    font-size: 14px;
    color: #ffffff !important;
}
form.search-form input::placeholder {
    color: rgba(255,255,255,0.6);
}
.search-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}
.search-btn:hover {
    color: #fff;
}
.search-form i {
    color: #ffffff;
    margin-right: 6px;
    font-size: 16px;
}
.search-form input:focus {
    outline: none;
    box-shadow: none;
}
.search-form input::placeholder {
    color: #6c757d;
    opacity: 0.8;
}
.search-form-mobile {
    display: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
    -webkit-text-fill-color: inherit !important;
    background-color: transparent !important;
    transition: background-color 9999s ease-in-out 0s;
}

form.search-form input:-webkit-autofill,
form.search-form input:-webkit-autofill:hover,
form.search-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: #ffffff;
    background-color: transparent !important;
}

@media (max-width: 1024px) {
    .brand-sub,
    .brand-title,
    .btn[title="Tela cheia"] {
        display: none;
    }    
    .brand-title-mobile,
    .search-form-mobile {
        display: block;
    }
    .iframe-buscar-funcao {
        display: none;
    }
    .search-modal {
        margin: 0;
        width: 95%;
        max-width: 95%;
    }
}

/* HEADER */

/* SIDEBAR */
/* Para Chrome, Edge e Safari */
.sidebar::-webkit-scrollbar {
    width: 8px;
}
.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
    border: 2px solid #f1f1f1;
}
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    border-right: 1px solid #ddd;
    padding: 20px 15px;
    overflow-y: auto;
    transition: background 0.3s, color 0.3s;
    background: #f8fafc;
    border-right: 1px solid #d0dae6;
    font-size: 14px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #f1f1f1;
}
.sidebar .menu-header {
    background: linear-gradient(90deg, #5b76a2, #748eb7);
    color: #fff;
    font-weight: 600;
    padding: 10px 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #b0bed3;
}
.sidebar .nav-link {
    color: #2d3e50;
    padding: 8px 15px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #e9edf2;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}
.sidebar .nav-link:hover {
    background-color: rgba(104, 131, 165, 0.1);
    border-left-color: var(--primary);
    color: #000;
}
.sidebar .nav-link.active {
    background-color: rgba(104, 131, 165, 0.2);
    border-left-color: #455A86;
    font-weight: 600;
}
/* SIDEBAR */

/* CONTEINER */
.session-bar {
    background-color: #f7f9fc;
    border: 1px solid #dbe3ef;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    padding: 0.75rem 0.75rem; 
}
.session-bar-icon {
    font-size: 1.4rem;
}
.session-bar strong {
    color: #455A86;
}
.main-container {
    margin-top: 0;
    margin-left: 0;
    padding: 24px;
    min-height: 100vh;
    background: #f9f9f9;
    transition: background 0.3s, color 0.3s;
}
.card, .card-light {
    border-radius: 10px;
    margin-bottom: 30px;
    -webkit-box-shadow: 2px 6px 15px 0 rgba(69, 65, 78, .1);
    -moz-box-shadow: 2px 6px 15px 0 rgba(69,65,78,.1);
    box-shadow: 2px 6px 15px 0 rgba(69, 65, 78, .1);
    border: 0;
}
.card-header {
    background-color: var(--primary);
    color: #fff;
    font-weight: 500;
    border-radius: 8px 8px 0 0; 
    padding: 10px 20px;
}
.card-body{
    padding: 16px 20px;
}
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);

    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
	background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
/* RESPONSIVO */
@media (max-width: 1024px) {
    .main-container {
        margin-left: 0; 
    }
    .session-bar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 4px;
        font-size: 13px;
        text-align: left;
    }
    .session-bar-icon {
        display: none;
    }

    .divAbas {
        max-width: 100%; 
        width: 100%; 
        margin: 20px 0 50px 0;
    }
}

/* Layout geral */
.layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}
/* Cabealho */
#cabecalho {
    width: 100%;
    height: var(--header-height);
    border: none;
    z-index: 1001;
}
/* rea principal */
.conteudo {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}
.divConsultar {
    max-width: 728px; 
    width: 100%; 
    margin: 20px 0 50px 0;
}
.divAbas,
.divDetalhar {
    width: 100%; 
    margin: 20px 0 50px 0;
}
.tdSumario {
    color: #fff;
    background-color: var(--primary);
    padding-left: 10px;
    border-radius: 4px;
}
.top-bar-container {
  display: flex;
  align-items: center;
  width: 100%;
  overflow: hidden;
  border-bottom: 2px solid #607d9d;
  transition: all 0.3s ease;
}
.breadcrumbTitle {
  color: #607d9b;
  font-weight: bold;
  padding: 8px 0px;
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .top-bar-container {
    flex-direction: column;
    align-items: stretch;
    border: none;
  }
  .breadcrumbTitle {
    width: 100%;
    text-align: left;
    padding: 10px;
  }
  .top-bar-container > .session-bar,
  .top-bar-container > div:last-child {
    width: 100%;
    margin-top: 8px;
  }
}

/* Menu lateral */
#menuSidebar {
    width: var(--sidebar-width);
    height: 100%;
    border-right: 1px solid #ccc;
    background-color: #f8f9fa;
    transition: width 0.3s ease;
    overflow: hidden;
    position: relative;
}
#menuSidebar iframe {
    width: 100%;
    height: 100%;
    border: none;
}
/* Contedo principal */
#principal {
    flex: 1;
    height: 100%;
    border: none;
    transition: width 0.3s ease;
}
/* Menu recolhido (desktop) */
.collapsed #menuSidebar {
    width: var(--sidebar-collapsed);
}
.collapsed #principal {
    width: 100%;
}
#menuOffCanvas {
    display: none;
}
#overlay {
    display: none;
}

@media (max-width: 1024px) {
    #menuSidebar {
        display: none;
    }
    #menuOffCanvas {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: -250px;
        width: 250px;
        height: calc(100% - var(--header-height));
        background: #f4f4f4;
        border-right: 1px solid #ccc;
        box-shadow: 2px 0 5px rgba(0,0,0,0.3);
        transition: left 0.3s ease;
        z-index: 1002;
    }
    #menuOffCanvas iframe {
        width: 100%;
        height: 100%;
        border: none;
    }
    #menuOffCanvas.active {
        left: 0;
    }
    #overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1001;
    }
    #overlay.active {
    opacity: 1;
    visibility: visible;
    }
}

/* Modal Buscar Funo */
.search-modal {
    border-radius: 12px;
    background-color: var(--primary);
    color: #fff;
    padding: 1rem 1.25rem 1.25rem;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}
.search-modal .modal-title {
  color: #fff;
}
.search-modal .btn-close {
  filter: brightness(0) invert(1);
}
.modal-backdrop.show {
    backdrop-filter: blur(5px);
    background-color: rgba(0, 0, 0, 0.3);
}

/* Boto flutuante de tema */
.theme-switcher {
    position: absolute ;
    bottom: 50px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 10%;
    background-color: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}
.theme-switcher:hover {
    background-color: var(--primary-dark);
    transform: scale(1.1);
}
.theme-switcher .btn {
    width: 45px;
    height: 45px;
    border-radius: 10%;
    background-color: var(--primary);
    color: white;
    border: none;
}
.theme-switcher .btn:hover {
    background-color: var(--primary-dark);
}
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary);
    color: #fff;
}

@media (max-width: 1024px) {
    .theme-switcher {
        bottom: 80px;
        right: 15px;
    }
}

/* Temas */
body.theme-light {
    background-color: #ffffff;
    color: #333;
}
body.theme-dark {
    background-color: #1e1e1e;
    color: #f1f1f1;
    filter: brightness(0.95);
}
body.theme-reading {
    background-color: #f5f0e6;
    color: #3b3024;
    filter: contrast(1.05);
}
body.theme-reading iframe {
    filter: brightness(0.95);
}
/* Tabela */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tdErro {
	padding: 0;
	font-weight: bold;
    --bs-table-bg: #f88282;
    --bs-table-color: #FFFFFF;
}
.tdErroAlternada {
	padding: 0;
	font-weight: bold;
	--bs-table-bg: #F86055;
    --bs-table-color: #FFFFFF;
}
.tdEscura {
	padding: 0;
	--bs-table-bg: #4E617E;
	--bs-table-color: #FFFFFF;
}
.tdHelp
{
    padding: 0;
	text-align: center;
	--bs-table-bg: #E3E6E9;
}
.card .table {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
    .table-responsive {
        width: 100%;
    }
}

/* Modal */
.modal .modal-content {
    background-color: var(--primary);
    color: #fff;
}
.modal .modal-title {
    color: #fff;
}

.modal .btn-close {
    filter: brightness(0) invert(1); /* deixa o X branco */
}
.modal .modal-body,
.modal .modal-header {
    color: #fff;
}
.modal-header,
.modal-footer {
    border-color: rgba(255,255,255,0.25);
}
/* ABAS */
.nav-pills .nav-link {
    background-color: var(--primary);
    color: white;
    border-radius: 0 !important; /* opcional */
}

/* Hover */
.nav-pills .nav-link:hover {
    background-color: var(--primary-dark);
    color: white;
}

/* Aba ativa */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--primary-dark);
    color: white;
}

.thead-custom th {
    background-color: #6883A5 !important;
    color: #fff !important;
}

/* Toast Custom */
.toast-custom {
    color: #ffffff;
}

/* Toast Info */
.toast-info .toast-header {
    background-color: #5d7698;
    border: 1px solid #5d7698;
}

.toast-info .toast-body {
    background-color: #6883A5;
    border: 1px solid #5d7698;
}
/* Toast Warning */
.toast-warning .toast-header {
    background-color: #d39e00;
    border: 1px solid #d39e00;
}

.toast-warning .toast-body {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #d39e00;
}

.toast-warning .btn-close {
    filter: none;
}
/* Toast Danger */
.toast-danger .toast-header {
    background-color: #f1aeb5;
    border: 1px solid #f1aeb5;
}

.toast-danger .toast-body {
    background-color: #f8d7da;
    color: #58151c;
    border: 1px solid #f1aeb5;
}
/* Toast Success */
.toast-success .toast-header {
    background-color: #a3cfbb;
    border: 1px solid #a3cfbb;
}

.toast-success .toast-body {
    background-color: #d1e7dd;
    color: #0a3622;
    border: 1px solid #a3cfbb;
}

@media (max-width: 767px) {
    .ca-listagem-bs { display: none !important; }
}

@media (min-width: 768px) {
    .lancamento-cards { display: none !important; }
}

@media (max-width: 767px) {

    .lancamento-cards p {
        margin: 0 !important;
        display: inline !important;
    }

    .lancamento-cards br {
        display: none !important;
    }
}

	/* Base da tabela de lançamentos do ca:listagem */
	.ca-listagem-bs table.table {
		width: 100%;
		margin-bottom: 1rem;
		color: #212529;
		border-collapse: collapse;
		font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
		font-size: 0.875rem;
	}

	/* Cabeçalho */
	.ca-listagem-bs table.table thead tr,
	.ca-listagem-bs table.table .header {
		--bs-table-color: #fff !important;
    	--bs-table-bg: #6883A5 !important;
		border-bottom: 2px solid #dee2e6;
	}

	.ca-listagem-bs table.table th,
	.ca-listagem-bs table.table .header td {
		padding: 0.75rem;
		font-weight: 600;
		text-align: left;
		vertical-align: middle;
		border: 1px solid #dee2e6;
		white-space: nowrap;
	}

	/* Corpo da tabela */
	.ca-listagem-bs table.table td {
		padding: 0.75rem;
		border: 1px solid #dee2e6;
	}

	/* Hover igual Bootstrap */
	.ca-listagem-bs table.table tbody tr:hover,
	.ca-listagem-bs table.table .tdPadrao:hover {
		background-color: #f1f3f5;
	}

	/* Checkbox alinhado */
	.ca-listagem-bs table.table input[type="checkbox"] {
		transform: scale(1.1);
		cursor: pointer;
	}

	/* Rodapé */
	.ca-listagem-bs table.table .footer {
		background-color: #f8f9fa;
		font-weight: 500;
		border-top: 2px solid #dee2e6;
	}

	/* Alinhamentos utilitários (compatível com Bootstrap) */
	.ca-listagem-bs .text-center { text-align: center !important; }
	.ca-listagem-bs .text-end { text-align: right !important; }
	.ca-listagem-bs .text-start { text-align: left !important; }

	/* Situações / status (opcional) */
	.ca-listagem-bs td:contains("BLOQUEADA") {
		color: #dc3545;
		font-weight: 600;
	}

	.ca-listagem-bs td:contains("EM ABERTO") {
		color: #fd7e14;
		font-weight: 600;
	}

	.ca-listagem-bs td:contains("COBRADA") {
		color: #198754;
		font-weight: 600;
	}

	.ca-listagem-bs input[type="checkbox"] {
		margin-right: 0.5rem;
	}
