.shadow { -moz-box-shadow: 3px 3px 7px 1px #CCC; -webkit-box-shadow: 3px 3px 7px 1px #CCC; box-shadow: 3px 3px 7px 1px #CCC; }
.sem-resultados { margin: 0 0 0 30px; color: #399; }
address { position: absolute; right: 0; bottom: -150px; color: #81D45F; text-align: center; font-size: 12px; }
.pesquisa { border: 1px solid #f6f6f6; box-shadow: none; background: #f6f6f6 url("../images/search-icon.png") no-repeat 10px 8px; padding: 0 5px 0 30px; border-radius: 100px; -webkit-border-radius: 100px; color: #339933; font-weight: 300; }
.painel-contas { }
.table { font-size: 13px; }
.table tfoot td { font-size: 14px; font-weight: bold; color: #036; }
.pagination-sm { margin: 10px 0; height: 21px; }
td.moeda { text-align: right !important; }
tr.impresso > td { background: #B4B4C1 !important; }
.dropdown-xs li { font-size: 12px; }
.dropdown-xs li a i, .dropdown-xs li a .glyphicon, .dropdown-xs li a .fa { width: 18px; text-align: center; margin-right: 4px; }
.painel-novo-pedido-li a { color: #333 !important; background: transparent; font-weight: normal; border-radius: 0; margin: 0; display: block; text-align: left; padding: 3px 20px; }
.painel-novo-pedido-li a:hover { background: #f5f5f5 !important; color: #333 !important; }
.form-control { color: #333333; }
input:-webkit-autofill {
    color: #fff !important;
}

/* Relatorio de comissao */
.relatorio-comissao-panel {
    border: 1px solid #d8e8df;
    overflow: hidden;
}

.relatorio-comissao-body {
    background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
}

.relatorio-comissao-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #195b78 0%, #245f8b 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(21, 79, 110, 0.12);
}

.relatorio-comissao-hero h2 {
    margin: 0 0 6px 0;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.relatorio-comissao-hero p {
    margin: 0;
    opacity: 0.95;
    font-size: 14px;
}

.relatorio-comissao-hero-badge .label {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    display: inline-block;
}

.relatorio-comissao-filtros > [class*="col-"] {
    margin-bottom: 12px;
}

.relatorio-comissao-btn-col .btn {
    margin-top: 1px;
    height: 38px;
}

.relatorio-comissao-checkbox-col {
    padding-top: 25px;
}

.relatorio-comissao-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.relatorio-comissao-loader {
    padding: 18px 0;
    color: #1f5674;
}

.relatorio-comissao-loader img {
    margin-right: 8px;
}

.relatorio-comissao-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.relatorio-comissao-cards--modal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.relatorio-comissao-card {
    background: #fff;
    border: 1px solid #dbe8ef;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 10px 24px rgba(42, 69, 97, 0.08);
}

.relatorio-comissao-card-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5e7a8a;
    margin-bottom: 8px;
}

.relatorio-comissao-card strong {
    display: block;
    font-size: 24px;
    color: #173c56;
    line-height: 1.1;
}

.relatorio-comissao-card small {
    display: block;
    margin-top: 8px;
    color: #688394;
    font-size: 12px;
}

.relatorio-comissao-table-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.relatorio-comissao-table-header h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    color: #173c56;
}

.relatorio-comissao-table-header p {
    margin: 0;
    color: #587184;
}

.relatorio-comissao-table-meta {
    display: flex;
    gap: 12px;
    color: #3c5c70;
    font-size: 13px;
}

.relatorio-comissao-table-wrap {
    background: #fff;
    border: 1px solid #dbe8ef;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(42, 69, 97, 0.06);
}

.relatorio-comissao-table {
    margin-bottom: 0;
}

.relatorio-comissao-table thead th {
    background: #eff7f2;
    color: #173c56;
    white-space: nowrap;
}

.relatorio-comissao-link {
    font-weight: 700;
    color: #0e6f8b;
}

.relatorio-comissao-modal-dialog {
    width: 92%;
    max-width: 1200px;
}

.relatorio-comissao-modal-header {
    background: linear-gradient(135deg, #0f7c55 0%, #1c8fce 100%);
    color: #fff;
}

.relatorio-comissao-modal-header .close {
    color: #fff;
    opacity: 1;
}

.relatorio-comissao-modal-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.relatorio-comissao-chart-card,
.relatorio-comissao-clientes-card,
.relatorio-comissao-produtos-card {
    background: #fff;
    border: 1px solid #dbe8ef;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(42, 69, 97, 0.06);
}

.relatorio-comissao-chart-card--principal {
    margin-bottom: 18px;
}

.relatorio-comissao-chart-head h4 {
    margin: 0 0 4px 0;
    color: #173c56;
}

.relatorio-comissao-chart-head p {
    margin: 0 0 14px 0;
    color: #698294;
}

.relatorio-comissao-chart {
    min-height: 360px;
}

.relatorio-comissao-chart--principal {
    min-height: 280px;
}

.relatorio-comissao-clientes-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.relatorio-comissao-cliente-item {
    border: 1px solid #e5eef5;
    border-radius: 14px;
    padding: 14px;
    background: #f9fcff;
}

.relatorio-comissao-cliente-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 12px;
}

.relatorio-comissao-cliente-top h5 {
    margin: 0 0 4px 0;
    color: #143b56;
    font-size: 16px;
}

.relatorio-comissao-cliente-top p {
    margin: 0;
    color: #688394;
}

.relatorio-comissao-cliente-total {
    font-size: 22px;
    font-weight: 700;
    color: #0f7c55;
    white-space: nowrap;
}

.relatorio-comissao-pedidos-table,
.relatorio-comissao-produtos-table {
    margin-bottom: 0;
}

.relatorio-comissao-pedidos-table--simples tfoot td {
    background: #f5fbf7;
    color: #173c56;
}

@media (max-width: 1199px) {
    .relatorio-comissao-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .relatorio-comissao-cards--modal {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .relatorio-comissao-hero,
    .relatorio-comissao-table-header,
    .relatorio-comissao-cliente-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .relatorio-comissao-cards,
    .relatorio-comissao-cards--modal {
        grid-template-columns: 1fr;
    }

    .relatorio-comissao-btn-col .btn {
        width: 100%;
    }

    .relatorio-comissao-checkbox-col {
        padding-top: 0;
    }

    .relatorio-comissao-table thead {
        display: none;
    }

    .relatorio-comissao-table tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #dbe8ef;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 18px rgba(42, 69, 97, 0.06);
    }

    .relatorio-comissao-table tbody td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
        border-top: 1px solid #edf3f7;
        padding: 10px 12px;
        text-align: left !important;
    }

    .relatorio-comissao-table tbody td:first-child {
        border-top: 0;
    }

    .relatorio-comissao-table tbody td:before {
        content: attr(data-label);
        font-weight: 700;
        color: #163a55;
        min-width: 92px;
    }

    .relatorio-comissao-chart {
        min-height: 280px;
    }

    .relatorio-comissao-pedidos-table--simples thead {
        display: none;
    }

    .relatorio-comissao-pedidos-table--simples tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #dbe8ef;
        border-radius: 14px;
        background: #fff;
    }

    .relatorio-comissao-pedidos-table--simples tbody td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border-top: 1px solid #edf3f7;
        padding: 10px 12px;
        text-align: left !important;
    }

    .relatorio-comissao-pedidos-table--simples tbody td:first-child {
        border-top: 0;
    }

    .relatorio-comissao-pedidos-table--simples tbody td:before {
        content: attr(data-label);
        font-weight: 700;
        color: #163a55;
        min-width: 82px;
    }
}
.panel-grey { border: 1px solid #CCCCCC; }
.tools a { text-transform: none; font-weight: bold; color: #FFF; letter-spacing: -1px; }
.tabela-resultados-produtos { height: 250px; overflow: scroll; }
.scroll-250px { height: 250px; overflow: scroll; }
.scroll-400px { height: 400px; overflow: scroll; }
#tabela-conferencia { margin-top: 15px; background-color: #F4F4F4 !important; border: 2px solid #999 !important; border-radius: 4px; }
#tabela-conferencia thead tr th { text-transform: uppercase !important; }
.tabela { margin-top: 15px; background-color: #F4F4F4 !important; border: 2px solid #999 !important; border-radius: 4px; }
.tabela thead tr th { color: #FFF; background: #57B952; text-align: center; text-transform: uppercase; }
.tabela tfoot tr td { color: #693; background: #FFF; }
.tabela2 { margin-top: 15px; background-color: #F4F4F4 !important; }
.tabela2 thead tr th { font-size: 10px; line-height: 10px; color: #FFF; background: #4caf50; text-align: center; text-transform: uppercase; }
.tabela2 tfoot tr td { color: #693; background: #FFF; }
.font85 { font-size: 85%; }
.title.badge { border-radius: 4px; padding: 5px; font-size: 14px; margin: 0 0 10px 0; }
.devedor, .negativo, .despesa, .debito { color: #F00 !important; }
.credor, .positivo, .receita, .credito { color: #036 !important; }
.datepicker { z-index: 1151 !important; }
.form-control { font-size: 13px; }
.relogio-logout { margin: 9px 10px 0 0; font-size: 11px; color: #fff; }
#cronometro { color: #fff; font-weight: bold; }
.total-registros { color: #699 !important; }
a.popup { color: #2A9086; }
#main-content { margin-left: 100px; margin-right: 100px; }
div.center { text-align: center; }
.table-striped > tbody > tr:nth-child(odd) > td, .table-striped > tbody > tr:nth-child(odd) > th { background-color: #D3ECD8; }
.table-striped > tbody > tr.sel:nth-child(even) > td, .table-striped > tbody > tr.sel:nth-child(even) > th { background-color: #f5f5f5; }
.table-striped > tbody > tr.sel:nth-child(odd) > td, .table-striped > tbody > tr.sel:nth-child(odd) > th { background-color: #60ecff; }
.btn-blch-vencidos { position: relative; }
.btn-blch-vencidos > div { display: none; position: absolute; width: 800px; top: 0; left: -650px; z-index: 100; }
.btn-pedidos-pagamento > div { display: none; position: absolute; width: 800px; z-index: 100; }
.btn-blch-vencidos:hover div { display: block; }
.btn-pedidos-pagamento:hover div { display: block; }
.atraso { color: #F00; font-weight: bold; }
.resumo-financeiro { background: #FFF; width: 250px; }
.resumo-financeiro td { color: #000; font-weight: normal; font-size: 12px; }
.resumo-financeiro thead th { color: #FFF; background-color: #1FB5AC; text-align: center; }
.resumo-financeiro tfoot td { padding: 4px; color: #FFF; font-weight: bold; background-color: #CCC; border-top: 1px dashed #000; }
.resumo-financeiro .btn-blch-vencidos > div { top: 0; left: -170px; z-index: 100; }

/* --- RESUMO FINANCEIRO V2 --- */
.rf2 {
	background: #fff;
	width: 200px;
	border-radius: 4px;
	box-shadow: 0 3px 12px rgba(0,0,0,0.2);
	font-size: 10px;
	overflow: visible;
	border: 1px solid #ddd;
}
.rf2-hd {
	background: #34495e;
	color: #fff;
	padding: 4px 8px;
	font-size: 10px;
	font-weight: 700;
	border-radius: 4px 4px 0 0;
}
.rf2-hd i { margin-right: 4px; }
.rf2-fechar { display: none; }
@media (max-width: 767px) {
	.rf2-fechar {
		display: block;
		float: right;
		background: none;
		border: none;
		color: #fff;
		font-size: 22px;
		font-weight: 700;
		line-height: 1;
		padding: 0;
		cursor: pointer;
		opacity: .8;
	}
	.rf2-fechar:hover { opacity: 1; }
}
.rf2-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rf2-tbl td { padding: 1px 6px; color: #444; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; }
.rf2-tbl td:first-child { white-space: nowrap; }
.rf2-v { text-align: right; font-weight: 600; white-space: nowrap; }
.rf2-sep td { height: 1px; padding: 0; background: #eee; }
.rf2-tot td { border-top: 1px dashed #bbb; padding-top: 3px; }
.rf2-ft {
	background: #f5f6f7;
	border-radius: 0 0 6px 6px;
	border-top: 1px solid #e0e0e0;
}
.rf2-ok .rf2-v { color: #27ae60 !important; }
.rf2-neg .rf2-v { color: #c0392b !important; }

/* Popup vencidos */
.rf2-venc-trigger {
	position: relative;
	cursor: pointer;
	color: #c0392b;
	font-weight: 700;
	border-bottom: 1px dotted #c0392b;
}
.rf2-venc-pop {
	display: none;
	position: absolute;
	z-index: 300;
	top: -8px;
	left: -310px;
	width: 340px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.25);
	border: 1px solid #e74c3c;
	overflow: hidden;
}
.rf2-venc-trigger:hover .rf2-venc-pop { display: block; }
.rf2-pop-hd {
	background: #c0392b;
	color: #fff;
	padding: 5px 10px;
	font-size: 11px;
	font-weight: 700;
}
.rf2-pop-hd i { margin-right: 4px; }
.rf2-pop-body { max-height: 200px; overflow-y: auto; }
.rf2-pop-tbl { width: 100%; border-collapse: collapse; font-size: 10px; }
.rf2-pop-tbl thead th {
	background: #fce4e4;
	color: #a93226;
	padding: 4px 6px;
	text-align: left;
	font-weight: 700;
	font-size: 9px;
	text-transform: uppercase;
	position: sticky;
	top: 0;
}
.rf2-pop-tbl tbody tr { border-bottom: 1px solid #f5f5f5; }
.rf2-pop-tbl tbody tr:hover { background: #fff5f5; }
.rf2-pop-tbl td { padding: 3px 6px; color: #333; }
.rf2-pop-dt { white-space: nowrap; color: #888; }
.rf2-pop-ds { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf2-pop-vl { text-align: right; font-weight: 600; color: #c0392b; white-space: nowrap; }
.rf2-pop-tbl tfoot td { padding: 4px 6px; background: #fce4e4; border-top: 1px solid #f5c6cb; }

/* Hover detalhes-conta V2 */
.detalhes-conta { position: relative; display: inline-block; cursor: pointer; }
.detalhes-conta .rf2 { display: none; position: absolute; z-index: 200; top: 100%; left: 0; margin-top: 4px; }
.detalhes-conta:hover .rf2 { display: block; }

/* Hamburger menu mobile */
.admin-menu-toggle { display: none; }
@media (max-width: 767px) {
	.admin-menu-toggle {
		display: block;
		width: 100%;
		padding: 8px;
		font-size: 13px;
		font-weight: 700;
		background: #2c6e8a;
		color: #fff;
		border: none;
		border-radius: 6px;
		margin-bottom: 4px;
	}
	.admin-menu-toggle.active { background: #1a4a5c; }
	.admin-menu-toggle i { margin-right: 6px; }
	.admin-shell-menu-grid { display: none !important; }
	.admin-shell-menu-grid.menu-grid-open { display: flex !important; flex-wrap: wrap; gap: 6px; }
	/* Reduz gaps entre header/menu/conteudo */
	body.admin-theme-blue .admin-shell-menu { margin-top: 0 !important; padding: 6px 8px !important; }
	.wrapper { margin-top: 0 !important; padding-top: 8px !important; }
	#main-content > .wrapper { margin-top: 0 !important; }
	#container .wrapper { margin-top: 0 !important; }
	/* Popup boletos/cheques vencidos - mobile: click, nao hover */
	.btn-blch-vencidos:hover > div { display: none !important; }
	.btn-blch-vencidos > div.blch-aberto { display: block !important; }
	.btn-blch-vencidos > div {
		position: fixed !important;
		left: 8px !important;
		right: 8px !important;
		top: 50% !important;
		bottom: auto !important;
		transform: translateY(-50%);
		width: auto !important;
		max-height: 80vh;
		z-index: 9999 !important;
		overflow-y: auto;
		border-radius: 12px;
		margin: 0 !important;
		box-shadow: 0 4px 24px rgba(0,0,0,0.3);
	}
	.btn-blch-vencidos > div .prf-border-head {
		font-size: 14px;
		margin: 0 0 8px;
	}
	.btn-blch-vencidos > div .lista-blch-vencidos { font-size: 12px; }
	.btn-blch-vencidos > div .lista-blch-vencidos td,
	.btn-blch-vencidos > div .lista-blch-vencidos th { padding: 6px 8px; }
	.btn-blch-vencidos > div .lista-blch-vencidos td:nth-child(2) { white-space: normal; word-break: break-word; max-width: 180px; }
	.btn-blch-vencidos > div .blch-fechar {
		font-size: 28px;
		padding: 4px 10px;
		line-height: 1;
	}
	/* Pedidos pagamento */
	.btn-pedidos-pagamento:hover > div { display: none !important; }
	.btn-pedidos-pagamento > div.blch-aberto { display: block !important; }
	.btn-pedidos-pagamento > div {
		position: fixed !important;
		left: 8px !important; right: 8px !important;
		top: 50% !important; bottom: auto !important;
		transform: translateY(-50%);
		width: auto !important;
		max-height: 80vh;
		z-index: 9999 !important;
		overflow-y: auto;
		border-radius: 12px;
		box-shadow: 0 4px 24px rgba(0,0,0,0.3);
	}
}

.responsavel { font-size: 85%; color: #6CF; display: block; }
.detalhes-conta:hover { cursor: pointer; position: relative; }
.detalhes-conta .resumo-financeiro { display: none; position: absolute; z-index: 100; }
.detalhes-conta:hover .resumo-financeiro { display: block; }
.total-marcados { color: #1FB5AD; }
.total-marcados > span { color: #13615A; font-weight: bold; }
.info { color: #06C !important; cursor: help; }

/* Filtro de contas contábeis */
.lista-contas-contabeis { background-color:#f5f5f5; border-radius: 5px; -webkit-border-radius: 5px; border:1px solid #CCC; margin:0; padding: 10px; position:absolute; z-index:3; width:350px; }
.lista-contas-contabeis label { margin:0 !important; padding:0 !important; }
.lista-contas { list-style: none; margin: 0; padding:0; height:200px; overflow:auto; }
.radio-header { color:#000; }
/* Ajustes do jQery UI Dialog */
.ui-dialog { background: #FFF; -moz-box-shadow: 3px 3px 7px 1px #CCC; -webkit-box-shadow: 3px 3px 7px 1px #CCC; box-shadow: 3px 3px 7px 1px #CCC; }
.ui-dialog-titlebar { background: #CCC !important; color: #000 !important; border: none !important; }
.ui-dialog-btn-close { background: none !important; border: none !important; color: #666; }
.ui-dialog-titlebar-buttonpane > button.ui-dialog-titlebar-close.hide {
    display: none !important;
}
.ui-dialog-titlebar-buttonpane > a.ui-dialog-titlebar-close,
.ui-dialog-titlebar > button.ui-dialog-titlebar-close,
.ui-dialog-titlebar > a.ui-dialog-titlebar-close {
    width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 50% !important;
    right: 8px !important;
    margin-top: -14px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #4e5f6d !important;
}
.ui-dialog-titlebar-buttonpane > a.ui-dialog-titlebar-close .ui-icon,
.ui-dialog-titlebar > button.ui-dialog-titlebar-close .ui-icon,
.ui-dialog-titlebar > a.ui-dialog-titlebar-close .ui-icon { display: none !important; }
.ui-dialog-titlebar-buttonpane > a.ui-dialog-titlebar-close:after,
.ui-dialog-titlebar > button.ui-dialog-titlebar-close:after,
.ui-dialog-titlebar > a.ui-dialog-titlebar-close:after {
    content: "\00d7";
    display: block;
    font-size: 22px;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
}

/* - Ajustes do Bootstrap - */
.form-control { border: 1px solid #b3b3b3; box-shadow: none; color: #000; }
.form-control:focus, #focusedInput { border: 1px solid #00A8B3; box-shadow: none; }
.form-horizontal .control-label { font-weight: 300; font-size: 14px; text-align: left; }
.control-label { text-align: left !important; }
input, textarea, select, button { outline: none !important; color: #000; }
.input-xs { background: #f6f6f6 url("../images/search-icon.png") no-repeat 7px 4px; background-size: auto 60%; height: 23px; padding: 0 5px 0 30px; font-size: 11px; line-height: 1.5; border-radius: 3px; }
select.input-xs { height: 23px; line-height: 23px; }
textarea.input-xs { height: auto; }

.fonte-pequena{
    font-size: 12px;
}

.producao-cancelada{
    background:#EA5353 !important;
    color: white !important;
}

.tag-estado {
    display: inline-block;
    padding: 0 7px;
    margin-right: 6px;
    border-radius: 1px;
    color: #FFF !important;
    font-size: 9px;
    font-weight: bold;
    line-height: 15px;
    top: -1px;
    position: relative;
    min-width: 50px;
    text-align: center;
    width: 90px;
}

.laranja{ background-color: #F4A460;}

.cinza{ background-color: #807E7B;}

.verde{ background-color: #88C775;}

.vermelho{ background-color: #F67273;}

.azul{ background-color: #5784B4;}

.azul-info{ background-color: #5bc0de;}

@media (max-width: 991.98px) {
    #main-content {
        margin-left: 15px;
        margin-right: 15px;
    }
    .row {
        flex-wrap: wrap;
    }
    .row > [class*="col-"] {
        padding-right: 5px;
        padding-left: 5px;
    }
    .form-group.row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .form-group.row .col-md-3,
    .form-group.row .col-md-4,
    .form-group.row .col-md-6 {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .table,
    .tabela,
    .tabela2 {
        font-size: 12px;
    }
    /* Quando a tabela estiver dentro de um wrapper responsivo, mantém o layout de tabela e o scroll no wrapper */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    /* Mantém o comportamento padrão do Bootstrap para tabelas responsivas,
       mas não força `display: table` quando uma tabela específica precisa virar layout em cards no mobile. */
    .table-responsive > .table {
        width: 100%;
        margin-bottom: 0;
    }
    .table-responsive > .table:not(.contas-table--stack) {
        display: table;
        overflow: visible;
    }
    .resumo-financeiro {
        width: 100%;
        max-width: 100%;
    }
    /* Resumo financeiro V2 mobile */
    .detalhes-conta .rf2 {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 65vh;
        overflow-y: auto;
        border-radius: 12px 12px 0 0;
        z-index: 9999 !important;
        box-shadow: 0 -3px 15px rgba(0,0,0,0.3);
    }
    .rf2 { width: 100% !important; }
    .rf2-venc-pop {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 55vh;
        border-radius: 12px 12px 0 0 !important;
        z-index: 10000 !important;
    }
    .rf2-pop-body { max-height: 40vh; }
    .rf2-pop-ds { max-width: 120px; }
}

.extrato-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.extrato-table-responsive table {
    min-width: 720px;
    table-layout: auto;
}
.extrato-table-responsive th,
.extrato-table-responsive td {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    #main-content {
        margin-left: 10px;
        margin-right: 10px;
    }
    .tabela thead tr th,
    .tabela tbody tr td,
    .tabela tfoot tr td,
    .tabela2 thead tr th,
    .tabela2 tbody tr td,
    .tabela2 tfoot tr td {
        font-size: 11px;
    }
    /* Evita estourar botões do menu no mobile (o menu já tem layout próprio) */
    .form-control {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 991.98px) {
    .extrato-search-row > [class*="col-"] {
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding-right: 0;
        padding-left: 0;
    }
    .extrato-search-row .form-group,
    .extrato-actions-row .form-group {
        margin-bottom: 10px;
    }
    .extrato-actions-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: flex-end;
        gap: 6px;
    }
    .extrato-actions-row > [class*="col-"] {
        flex: 1 1 180px;
    }
    .extrato-actions-row .extrato-filtro-btn {
        flex: 0 0 auto;
    }
    .extrato-estado-col {
        margin-left: auto !important;
        order: 3;
    }
    .extrato-search-row {
        justify-content: flex-end;
    }
    .extrato-search-row .form-group {
        flex: 1 1 220px;
    }
    .extrato-search-button {
        display: flex;
        justify-content: flex-end;
    }
    .extrato-search-button button {
        margin-top: 6px;
    }
    .extrato-actions-row {
        gap: 4px;
    }
    .extrato-opcoes-col label,
    .extrato-estado-col label {
        display:flex;
        flex-direction: column;
        gap:4px;
    }
    .extrato-opcoes-col select,
    .extrato-estado-col select {
        width: 100%;
    }
    .detalhes-conta {
        display: inline-flex;
        flex-wrap: wrap;
    }
    .detalhes-conta .badge.bg-danger {
        order: 2;
        margin-left: 6px;
    }
    .detalhes-conta span:first-child {
        flex: 1 1 100%;
    }
}

/* Contas a pagar/receber:
   - tablet: scroll horizontal (tabela larga)
   - celular: layout em "cards" (sem scroll lateral) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .contas-table-responsive {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .contas-table-responsive .table {
        display: table;
        width: 100%;
        overflow: visible;
        min-width: 980px;
        table-layout: auto;
    }
    .contas-table-responsive .table th,
    .contas-table-responsive .table td {
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    /* No celular, o wrapper de Contas a Pagar/Receber não deve criar rolagem lateral;
       a tabela vira layout em cards e ocupa 100% da largura. */
    .contas-table-responsive {
        overflow: visible;
    }
    .contas-table-responsive > .contas-table--stack {
        display: block !important;
    }

    /* Extrato cliente: cards no mobile */
    .extrato-table-responsive {
        overflow: visible !important;
    }
    .extrato-table-responsive table {
        min-width: 0 !important;
        table-layout: auto !important;
    }
    .extrato-table-responsive table thead {
        display: none;
    }
    .extrato-table-responsive table,
    .extrato-table-responsive table tbody,
    .extrato-table-responsive table tr,
    .extrato-table-responsive table td {
        display: block;
        width: 100%;
    }
    .extrato-table-responsive table tbody tr {
        background: #fff;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        margin: 0 0 10px 0;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0,0,0,.06);
    }
    .extrato-table-responsive table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
        padding: 5px 10px !important;
        border: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        white-space: normal !important;
        font-size: 13px;
    }
    .extrato-table-responsive table td:last-child {
        border-bottom: none !important;
    }
    .extrato-table-responsive table td:before {
        content: attr(data-label);
        flex: 0 0 38%;
        font-weight: 600;
        color: #555;
        font-size: 12px;
    }
    .extrato-table-responsive table td[data-label="Selecionar"] {
        display: none;
    }
    .extrato-table-responsive table td[data-mobile-type="actions"] {
        justify-content: center;
        background: #f8f9fa;
    }
    .extrato-table-responsive table td[data-mobile-type="actions"]:before {
        display: none;
    }
    .extrato-table-responsive table td[data-mobile-type="amount"] {
        font-size: 15px;
        font-weight: 700;
        background: #f8f9fa;
    }
    .extrato-table-responsive table td[data-mobile-type="amount"]:before {
        font-size: 13px;
    }
    .extrato-table-responsive table td[data-label="Descricao"] {
        flex-direction: column;
        gap: 2px;
    }
    .extrato-table-responsive table td[data-label="Descricao"]:before {
        flex: none;
        margin-bottom: 2px;
    }

    /* tabela em cards no celular */
    .contas-table--stack {
        min-width: 0 !important;
        table-layout: auto !important;
    }

    .contas-table--stack thead {
        display: none;
    }

    .contas-table--stack,
    .contas-table--stack tbody,
    .contas-table--stack tr,
    .contas-table--stack td {
        display: block;
        width: 100%;
    }

    .contas-table--stack tr {
        background: #fff;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        margin: 0 0 10px 0;
        overflow: hidden;
    }

    .contas-table--stack td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        padding: 6px 8px !important;
        border: none !important;
        border-bottom: 1px solid #eee !important;
        white-space: normal !important;
    }

    .contas-table--stack td:last-child {
        border-bottom: none !important;
    }

    .contas-table--stack td:before {
        content: "";
        flex: 0 0 42%;
        font-weight: 600;
        color: #555;
    }

    /* Não mostra "label" nas colunas de checkbox/ações */
    .contas-table--stack td:nth-of-type(1):before,
    .contas-table--stack td:nth-of-type(2):before {
        content: "";
    }

    /* Labels - Contas a Pagar */
    .contas-table--pagar td:nth-of-type(3):before { content: "D. Criação"; }
    .contas-table--pagar td:nth-of-type(4):before { content: "D. Referência"; }
    .contas-table--pagar td:nth-of-type(5):before { content: "Data"; }
    .contas-table--pagar td:nth-of-type(6):before { content: "Descrição"; }
    .contas-table--pagar td:nth-of-type(7):before { content: "Contato"; }
    .contas-table--pagar td:nth-of-type(8):before { content: "Conta Contábil"; }
    .contas-table--pagar td:nth-of-type(9):before { content: "Conta"; }
    .contas-table--pagar td:nth-of-type(10):before { content: "Valor"; }
    .contas-table--pagar td:nth-of-type(11):before { content: "Anexo 1"; }
    .contas-table--pagar td:nth-of-type(12):before { content: "Anexo 2"; }
    .contas-table--pagar td:nth-of-type(13):before { content: "Anexo 3"; }
    .contas-table--pagar td:nth-of-type(14):before { content: "Pago"; }

    /* Labels - Contas a Receber */
    .contas-table--receber td:nth-of-type(3):before { content: "D. Criação"; }
    .contas-table--receber td:nth-of-type(4):before { content: "D. Referência"; }
    .contas-table--receber td:nth-of-type(5):before { content: "D. Recebimento"; }
    .contas-table--receber td:nth-of-type(6):before { content: "Data"; }
    .contas-table--receber td:nth-of-type(7):before { content: "Descrição"; }
    .contas-table--receber td:nth-of-type(8):before { content: "Vendedor"; }
    .contas-table--receber td:nth-of-type(9):before { content: "Contato"; }
    .contas-table--receber td:nth-of-type(10):before { content: "Conta Contábil"; }
    .contas-table--receber td:nth-of-type(11):before { content: "Conta"; }
    .contas-table--receber td:nth-of-type(12):before { content: "Valor"; }
    .contas-table--receber td:nth-of-type(13):before { content: "Boleto"; }
    .contas-table--receber td:nth-of-type(14):before { content: "Check"; }
    .contas-table--receber td:nth-of-type(15):before { content: "Situação"; }
}

/* Modais "Incluir despesa/receita": layout responsivo */
@media (max-width: 767.98px) {
    #modal-incluir-despesa .modal-dialog,
    #modal-incluir-receita .modal-dialog,
    #modal-incluir-recebimento .modal-dialog {
        width: auto !important;
        margin: 5px !important;
    }

    #modal-incluir-despesa .modal-content,
    #modal-incluir-receita .modal-content,
    #modal-incluir-recebimento .modal-content {
        max-height: calc(100vh - 20px);
        overflow: hidden;
        border-radius: 6px;
    }

    #modal-incluir-despesa .modal-body,
    #modal-incluir-receita .modal-body,
    #modal-incluir-recebimento .modal-body {
        max-height: calc(100vh - 120px);
        padding: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #modal-incluir-recebimento .modal-header {
        padding: 10px 15px;
    }

    #modal-incluir-recebimento .title.badge {
        display: block;
        white-space: normal;
        line-height: 1.3;
    }

    /* No celular: body rola e footer aparece */
    #modal-incluir-recebimento .modal-content {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 20px);
    }
    #modal-incluir-recebimento .modal-body {
        flex: 1 1 auto;
        max-height: none;
        min-height: 0;
    }
    #modal-incluir-recebimento .modal-footer {
        flex: 0 0 auto;
        margin-top: auto;
        background: #fff;
        border-top: 1px solid #eee;
        padding: 10px 12px;
        position: sticky;
        bottom: 0;
        z-index: 2;
    }
    #modal-incluir-recebimento .modal-footer .form-group,
    #modal-incluir-recebimento .modal-footer .col-lg-12,
    #modal-incluir-recebimento .modal-footer .pull-right {
        float: none !important;
        width: 100% !important;
        margin: 0;
        padding: 0;
    }
    #modal-incluir-recebimento .modal-footer .btn {
        width: 100%;
        margin-top: 6px;
    }
    #modal-incluir-recebimento .modal-footer .btn:first-child {
        margin-top: 0;
    }

    #modal-incluir-recebimento .form .row > [class*="col-"],
    #modal-incluir-recebimento .form-group .row > [class*="col-"] {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 10px;
    }

    #modal-incluir-recebimento .lista-de-lancamentos > .col-lg-2,
    #modal-incluir-recebimento .lista-de-lancamentos > .col-lg-4 {
        width: 100%;
    }

    #modal-incluir-recebimento .juros-multas-boletos,
    #modal-incluir-recebimento .dados-cheque,
    #modal-incluir-recebimento .juros-multas {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 6px;
    }

    #modal-incluir-recebimento .lista-de-lancamentos {
        display: flex;
        flex-direction: column;
    }

    #modal-incluir-recebimento .juros-multas-boletos > [class*="col-"],
    #modal-incluir-recebimento .dados-cheque > [class*="col-"],
    #modal-incluir-recebimento .juros-multas > [class*="col-"] {
        float: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #modal-incluir-recebimento .juros-multas-boletos > .col-lg-1,
    #modal-incluir-recebimento .juros-multas > .col-lg-2,
    #modal-incluir-recebimento .dados-cheque > .col-lg-1 {
        flex: 1 1 calc(50% - 6px);
    }
    #modal-incluir-recebimento .dados-cheque > .col-lg-2 {
        flex: 1 1 100%;
    }

    #modal-incluir-recebimento .btn.btn-default.info-boleto {
        width: 100%;
        text-align: left;
    }

    #modal-incluir-recebimento .col-descricao {
        flex: 1 1 100%;
    }

    /* Parcelas: no mobile vira "cards" */
    #modal-incluir-recebimento #lista-lancamentos > .row:nth-of-type(2) {
        display: none;
    }
    #modal-incluir-recebimento #btn-gerar-parcelas {
        width: 100%;
    }
    #modal-incluir-recebimento .lista-de-lancamentos {
        background: #fff;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        padding: 8px;
        margin: 10px 0;
    }
    #modal-incluir-recebimento .lista-de-lancamentos > [class*="col-"],
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas-boletos > [class*="col-"],
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas > [class*="col-"],
    #modal-incluir-recebimento .lista-de-lancamentos .dados-cheque > [class*="col-"] {
        margin-bottom: 8px;
    }
    #modal-incluir-recebimento .lista-de-lancamentos > [class*="col-"]::before,
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas-boletos > [class*="col-"]::before,
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas > [class*="col-"]::before,
    #modal-incluir-recebimento .lista-de-lancamentos .dados-cheque > [class*="col-"]::before {
        display: block;
        font-size: 11px;
        font-weight: 600;
        color: #666;
        margin: 0 0 4px 0;
    }
    #modal-incluir-recebimento .lista-de-lancamentos > .col-lg-2:nth-of-type(1)::before { content: "Vencimento"; }
    #modal-incluir-recebimento .lista-de-lancamentos > .col-descricao::before { content: "Descrição"; }
    #modal-incluir-recebimento .lista-de-lancamentos > .col-valor::before { content: "Valor R$"; }
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas-boletos .col-lg-1:nth-of-type(1)::before { content: "% Juros"; }
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas-boletos .col-lg-1:nth-of-type(2)::before { content: "% Multa"; }
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas-boletos .col-lg-1:nth-of-type(3)::before { content: "R$ Juros"; }
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas-boletos .col-lg-1:nth-of-type(4)::before { content: "R$ Multa"; }
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas .col-lg-2:nth-of-type(1)::before { content: "Multa R$"; }
    #modal-incluir-recebimento .lista-de-lancamentos .juros-multas .col-lg-2:nth-of-type(2)::before { content: "Juros R$"; }
    #modal-incluir-recebimento .lista-de-lancamentos .dados-cheque .col-lg-1:nth-of-type(1)::before { content: "Nº Cheque"; }
    #modal-incluir-recebimento .lista-de-lancamentos .dados-cheque .col-lg-2:nth-of-type(1)::before { content: "Banco"; }
    #modal-incluir-recebimento .lista-de-lancamentos .dados-cheque .col-lg-1:nth-of-type(2)::before { content: "Foto"; }

    #modal-incluir-recebimento .lista-de-lancamentos .input-group {
        width: 100%;
    }
    #modal-incluir-recebimento .lista-de-lancamentos .col-descricao .input-group {
        display: block;
    }
    #modal-incluir-recebimento .lista-de-lancamentos .col-descricao .input-group-addon {
        display: block;
        width: 100%;
        white-space: normal;
        text-align: left;
    }
    #modal-incluir-recebimento .lista-de-lancamentos .info-adicionais-boleto {
        margin-top: 6px;
    }
}

/* Contas a pagar/receber:
   - tablet: scroll horizontal (tabela larga)
   - celular: layout em "cards" (sem scroll lateral) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .contas-table-responsive {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .contas-table-responsive .table {
        display: table;
        width: 100%;
        overflow: visible;
        min-width: 980px;
        table-layout: auto;
    }
    .contas-table-responsive .table th,
    .contas-table-responsive .table td {
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    /* No celular, o wrapper de Contas a Pagar/Receber não deve criar rolagem lateral;
       a tabela vira layout em cards e ocupa 100% da largura. */
    .contas-table-responsive {
        overflow: visible;
    }
    .contas-table-responsive > .contas-table--stack {
        display: block !important;
    }

    /* Extrato cliente: cards no mobile */
    .extrato-table-responsive {
        overflow: visible !important;
    }
    .extrato-table-responsive table {
        min-width: 0 !important;
        table-layout: auto !important;
    }
    .extrato-table-responsive table thead {
        display: none;
    }
    .extrato-table-responsive table,
    .extrato-table-responsive table tbody,
    .extrato-table-responsive table tr,
    .extrato-table-responsive table td {
        display: block;
        width: 100%;
    }
    .extrato-table-responsive table tbody tr {
        background: #fff;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        margin: 0 0 10px 0;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0,0,0,.06);
    }
    .extrato-table-responsive table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
        padding: 5px 10px !important;
        border: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        white-space: normal !important;
        font-size: 13px;
    }
    .extrato-table-responsive table td:last-child {
        border-bottom: none !important;
    }
    .extrato-table-responsive table td:before {
        content: attr(data-label);
        flex: 0 0 38%;
        font-weight: 600;
        color: #555;
        font-size: 12px;
    }
    .extrato-table-responsive table td[data-label="Selecionar"] {
        display: none;
    }
    .extrato-table-responsive table td[data-mobile-type="actions"] {
        justify-content: center;
        background: #f8f9fa;
    }
    .extrato-table-responsive table td[data-mobile-type="actions"]:before {
        display: none;
    }
    .extrato-table-responsive table td[data-mobile-type="amount"] {
        font-size: 15px;
        font-weight: 700;
        background: #f8f9fa;
    }
    .extrato-table-responsive table td[data-mobile-type="amount"]:before {
        font-size: 13px;
    }
    .extrato-table-responsive table td[data-label="Descricao"] {
        flex-direction: column;
        gap: 2px;
    }
    .extrato-table-responsive table td[data-label="Descricao"]:before {
        flex: none;
        margin-bottom: 2px;
    }

    /* tabela em cards no celular */
    .contas-table--stack {
        min-width: 0 !important;
        table-layout: auto !important;
    }

    .contas-table--stack thead {
        display: none;
    }

    .contas-table--stack,
    .contas-table--stack tbody,
    .contas-table--stack tr,
    .contas-table--stack td {
        display: block;
        width: 100%;
    }

    .contas-table--stack tr {
        background: #fff;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        margin: 0 0 10px 0;
        overflow: hidden;
    }

    .contas-table--stack td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        padding: 6px 8px !important;
        border: none !important;
        border-bottom: 1px solid #eee !important;
        white-space: normal !important;
    }

    .contas-table--stack td:last-child {
        border-bottom: none !important;
    }

    .contas-table--stack td:before {
        content: "";
        flex: 0 0 42%;
        font-weight: 600;
        color: #555;
    }

    /* Não mostra "label" nas colunas de checkbox/ações */
    .contas-table--stack td:nth-of-type(1):before,
    .contas-table--stack td:nth-of-type(2):before {
        content: "";
    }

    /* Labels - Contas a Pagar */
    .contas-table--pagar td:nth-of-type(3):before { content: "D. Criação"; }
    .contas-table--pagar td:nth-of-type(4):before { content: "D. Referência"; }
    .contas-table--pagar td:nth-of-type(5):before { content: "Data"; }
    .contas-table--pagar td:nth-of-type(6):before { content: "Descrição"; }
    .contas-table--pagar td:nth-of-type(7):before { content: "Contato"; }
    .contas-table--pagar td:nth-of-type(8):before { content: "Conta Contábil"; }
    .contas-table--pagar td:nth-of-type(9):before { content: "Conta"; }
    .contas-table--pagar td:nth-of-type(10):before { content: "Valor"; }
    .contas-table--pagar td:nth-of-type(11):before { content: "Anexo 1"; }
    .contas-table--pagar td:nth-of-type(12):before { content: "Anexo 2"; }
    .contas-table--pagar td:nth-of-type(13):before { content: "Anexo 3"; }
    .contas-table--pagar td:nth-of-type(14):before { content: "Pago"; }

    /* Labels - Contas a Receber */
    .contas-table--receber td:nth-of-type(3):before { content: "D. Criação"; }
    .contas-table--receber td:nth-of-type(4):before { content: "D. Referência"; }
    .contas-table--receber td:nth-of-type(5):before { content: "D. Recebimento"; }
    .contas-table--receber td:nth-of-type(6):before { content: "Data"; }
    .contas-table--receber td:nth-of-type(7):before { content: "Descrição"; }
    .contas-table--receber td:nth-of-type(8):before { content: "Vendedor"; }
    .contas-table--receber td:nth-of-type(9):before { content: "Contato"; }
    .contas-table--receber td:nth-of-type(10):before { content: "Conta Contábil"; }
    .contas-table--receber td:nth-of-type(11):before { content: "Conta"; }
    .contas-table--receber td:nth-of-type(12):before { content: "Valor"; }
    .contas-table--receber td:nth-of-type(13):before { content: "Boleto"; }
    .contas-table--receber td:nth-of-type(14):before { content: "Check"; }
    .contas-table--receber td:nth-of-type(15):before { content: "Situação"; }
}

/* Modais "Incluir despesa/receita": força layout usável no celular */
@media (max-width: 767.98px) {
    #modal-incluir-despesa .modal-dialog,
    #modal-incluir-receita .modal-dialog {
        width: auto !important; /* sobrescreve width inline */
        margin: 10px !important;
    }

    #modal-incluir-despesa .modal-content,
    #modal-incluir-receita .modal-content {
        max-height: calc(100vh - 20px);
        overflow: hidden;
    }

#modal-incluir-despesa .modal-body,
#modal-incluir-receita .modal-body {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#modal-incluir-recebimento .form .row .col-lg-2,
#modal-incluir-recebimento .form .row .col-lg-3,
#modal-incluir-recebimento .form .row .col-lg-4,
#modal-incluir-recebimento .form .row .col-lg-1 {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 10px;
}
#modal-incluir-recebimento .lista-de-lancamentos .col-lg-2,
#modal-incluir-recebimento .lista-de-lancamentos .col-lg-4,
#modal-incluir-recebimento .lista-de-lancamentos .col-lg-1 {
    width: 100%;
}
#modal-incluir-recebimento .juros-multas-boletos,
#modal-incluir-recebimento .dados-cheque,
#modal-incluir-recebimento .juros-multas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

/* Santander API (novo): ocultar juros/multa no modal de recebimento quando ativo */
#modal-incluir-recebimento.santander-api-ativo .juros-multas-boletos {
    display: none !important;
}
#modal-incluir-recebimento .juros-multas-boletos .col-lg-1,
#modal-incluir-recebimento .dados-cheque .col-lg-1,
#modal-incluir-recebimento .juros-multas .col-lg-2 {
    width: 100%;
}
#modal-incluir-recebimento .btn.btn-default.info-boleto {
    width: 100%;
    text-align: left;
}

    #modal-incluir-recebimento .modal-dialog {
        width: auto !important;
        margin: 5px;
    }
    #modal-incluir-recebimento .modal-content {
        max-height: calc(100vh - 50px);
        border-radius: 6px;
    }
    #modal-incluir-recebimento .modal-body {
        max-height: calc(100vh - 130px);
        overflow-y: auto;
        padding: 12px;
        -webkit-overflow-scrolling: touch;
    }
    #modal-incluir-recebimento .modal-header {
        padding: 10px 15px;
    }
    #modal-incluir-recebimento .form .row,
    #modal-incluir-recebimento .form-group .row {
        flex-wrap: wrap;
    }
    #modal-incluir-recebimento .form .row > [class*="col-"] {
        width: 100%;
        padding-right: 4px;
        padding-left: 4px;
    }
    #modal-incluir-recebimento .lista-de-lancamentos .col-lg-2,
    #modal-incluir-recebimento .lista-de-lancamentos .col-lg-4 {
        width: 100%;
    }
    #modal-incluir-recebimento .col-descricao {
        flex: 1 1 100%;
    }
}

/* ===== Menu principal (admin) ===== */
section.menu .menu-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 10px;
}

section.menu .menu-item,
section.menu .btn-group {
    display: inline-flex;
}

section.menu .btn-group {
    display: inline-block;
}

section.menu .menu-item > button.btn,
section.menu .menu-item > .btn,
section.menu .btn-group > button.btn,
section.menu .btn-group > .btn {
    font-size: 12px;
    padding: 2px 8px;
    line-height: 1.35;
    white-space: nowrap;
}

/* Desktop/tablet: desce um pouco o bloco do menu abaixo do header */
@media (min-width: 768px) {
    section.menu {
        margin-top: 80px;
    }
}

/* Topo (sino/usuário) – mantém no canto direito no desktop */
.top-nav {
    float: right;
}

/* Mobile: menu em grid compacto e uniforme (sem botões gigantes) */
@media (max-width: 767.98px) {
    /* Logo centralizada e topo (sino/usuário) mais alto no celular */
    .brand {
        float: none !important;
        width: 100% !important;
        height: auto !important;
        text-align: center;
    }

    .brand img {
        max-width: 180px;
        height: auto !important;
        float: none !important;
        display: inline-block !important;
    }

    .top-nav {
        float: none !important;
        width: 100% !important;
        text-align: center;
        margin: 4px 0 0 0 !important;
    }

    .relogio-logout {
        display: none !important;
    }

    .notify-row {
        float: none !important;
        display: inline-block;
        margin: 4px 0 0 0 !important;
    }

    ul.top-menu > li > a {
        font-size: 12px;
        padding: 0 6px;
    }

    section.menu {
        margin-top: 0 !important;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    #main-content > .wrapper {
        margin-top: 0 !important;
    }

    section.menu .menu-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 6px;
        padding: 0 10px;
        justify-content: stretch;
    }

    section.menu .menu-item,
    section.menu .btn-group {
        width: 100%;
    }

    section.menu .menu-item > button.btn,
    section.menu .menu-item > .btn,
    section.menu .btn-group > button.btn,
    section.menu .btn-group > .btn {
        width: 100%;
        font-size: 10.5px;
        padding: 5px 7px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    section.menu .btn-group > .dropdown-toggle {
        position: relative;
        padding-right: 18px;
    }

    section.menu .btn-group > .dropdown-toggle .caret {
        position: absolute;
        right: 8px;
        top: 50%;
        margin-top: -2px;
    }

    section.menu .dropdown-menu {
        max-height: 65vh;
        overflow-y: auto;
    }

    /* Totais (pendentes/pagas/total) em Contas a Pagar/Receber:
       no mobile o `.box-fixed` do tema sobrepõe os cards (fica tudo no mesmo lugar),
       então desativamos o "fixed" para aparecerem os 3 normalmente. */
    .box-fixed {
        position: static !important;
        bottom: auto !important;
        padding-right: 0 !important;
        box-shadow: 0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .28);
    }

    .mini-charts-item.box-fixed {
        margin-top: 10px;
    }

    /* Deixa os "cards" menores no celular */
    .mini-charts-item {
        padding: 8px 10px;
        min-height: 0;
    }

    .mini-charts-item .count {
        padding: 0;
    }

    .mini-charts-item .count > small {
        font-size: 10px;
        line-height: 1.2;
    }

    .mini-charts-item .count > h2 {
        font-size: 14px;
        line-height: 1.2;
        margin-top: 4px;
    }
}
