/* Ajustes para celular e tablet (não altera o layout em telas grandes) */
img, video { max-width: 100%; height: auto; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media only screen and (max-width: 768px) {
	html { -webkit-text-size-adjust: 100%; }
	body { overflow-x: hidden; }

	/* Tabelas: rolagem lateral em vez de estourar a tela */
	.panel-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.dataTables_wrapper { overflow-x: auto; }
	.dataTables_wrapper .dataTables_length,
	.dataTables_wrapper .dataTables_filter,
	.dataTables_wrapper .dataTables_info,
	.dataTables_wrapper .dataTables_paginate { float: none !important; text-align: center !important; margin: 6px 0; }
	.dataTables_wrapper .dataTables_filter input { width: 100% !important; margin-left: 0 !important; }
	table.table td, table.table th { white-space: nowrap; }

	/* Janelas (modais) ocupando a tela */
	.modal-dialog { width: auto !important; margin: 8px !important; }
	.modal-content { border-radius: 14px; }
	.modal-body { max-height: calc(100vh - 170px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
	.modal-footer .btn { margin: 4px 0 0 !important; }
	/* Listas suspensas (bootstrap-select) dentro de janelas: abrem dentro da janela, sem serem cortadas pela rolagem */
	.modal-body .bootstrap-select.open > .dropdown-menu { position: static !important; float: none; width: 100%; max-height: 50vh; overflow-y: auto; box-shadow: none; }

	/* Formulários empilhados e sem zoom automático no iPhone */
	.form-horizontal .control-label { text-align: left !important; padding-bottom: 4px; }
	input.form-control, select.form-control, textarea.form-control { font-size: 16px !important; }
	.form-group-separated .form-group > div[class*="col-"] { border-left: 0 !important; }

	/* Cabeçalhos, títulos e botões */
	.page-title h2 { font-size: 18px !important; }
	.breadcrumb { white-space: nowrap; overflow-x: auto; }
	.panel-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
	.panel-heading .panel-title { float: none !important; flex: 1 1 auto; min-width: 0; }
	.panel-heading .panel-controls { float: none !important; margin-left: auto; }
	.panel-footer .btn, .btn-group { margin-bottom: 4px; }
	.page-content-wrap { padding-left: 4px; padding-right: 4px; }

	/* Barra superior: itens compactos */
	.x-navigation-horizontal .SpanIco { width: auto !important; padding: 0 6px !important; font-size: 12px; }
	.x-navigation.x-navigation-horizontal > li.xn-icon-button > a { padding-left: 10px; padding-right: 10px; }

	/* Área segura (iPhone com notch) quando instalado como app */
	.page-container { padding-bottom: env(safe-area-inset-bottom); }
}

@media only screen and (max-width: 480px) {
	.col-xs-hide-480 { display: none !important; }
	.panel-heading .panel-title small { display: block; margin-top: 2px; }
	.message-box .mb-container { width: 94% !important; left: 3% !important; }
}

/* Botões flutuantes: instalar app e ativar notificações */
.PwaChips { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 1040; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.PwaChip { display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; border: 0; border-radius: 999px; cursor: pointer;
	font: 700 13px/1 "Inter", system-ui, sans-serif; color: #04111f; background: linear-gradient(115deg, #3b82f6, #22d3ee 50%, #34d399);
	box-shadow: 0 14px 30px -12px rgba(34, 211, 238, .9); animation: PwaEntra .4s ease both; }
.PwaChip .PwaFechar { margin-left: 4px; opacity: .55; font-size: 15px; line-height: 1; }
.PwaChip[hidden] { display: none; }
@keyframes PwaEntra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.PwaDica { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1050; padding: 16px 18px; border-radius: 16px;
	background: #0b1324; color: #eaf4ff; font: 14px/1.5 "Inter", system-ui, sans-serif; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8); border: 1px solid rgba(255, 255, 255, .12); }
.PwaDica b { color: #22d3ee; }
