/*
 * Compatibilidade Bootstrap 3 → 5 para o SOLE.
 * Mantém classes antigas usadas nas páginas sem reescrever cada tela.
 */
.col-xs-1 { flex: 0 0 auto; width: 8.33333333%; }
.col-xs-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-xs-3 { flex: 0 0 auto; width: 25%; }
.col-xs-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-xs-5 { flex: 0 0 auto; width: 41.66666667%; }
.col-xs-6 { flex: 0 0 auto; width: 50%; }
.col-xs-7 { flex: 0 0 auto; width: 58.33333333%; }
.col-xs-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-xs-9 { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }

.pull-left { float: left !important; }
.pull-right { float: right !important; }
.pull-right-container { float: right; }

.hidden-xs { display: none !important; }
@media (min-width: 768px) {
  .hidden-xs { display: initial !important; }
}

.visible-xs { display: block !important; }
@media (min-width: 768px) {
  .visible-xs { display: none !important; }
}

.btn-default {
  --bs-btn-color: #122739;
  --bs-btn-bg: #fff;
  --bs-btn-border-color: rgba(18, 39, 57, 0.22);
  --bs-btn-hover-color: #122739;
  --bs-btn-hover-bg: #f3f5f8;
  --bs-btn-hover-border-color: rgba(18, 39, 57, 0.28);
  --bs-btn-active-color: #122739;
  --bs-btn-active-bg: #eef3f8;
  --bs-btn-active-border-color: rgba(18, 39, 57, 0.28);
}

.btn-xs {
  padding: 0.1rem 0.35rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}

.input-group-addon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.42857143;
  color: #5c6b7a;
  text-align: center;
  white-space: nowrap;
  background-color: #f7f9fb;
  border: 1px solid rgba(18, 39, 57, 0.16);
  flex: 0 0 auto;
  min-height: 34px;
  border-radius: 0;
}

.input-group > .input-group-addon:first-child {
  border-right: 0;
  border-radius: 6px 0 0 6px;
}

.input-group > .input-group-addon:last-child {
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.input-group > .input-group-addon:not(:first-child):not(:last-child) {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > select.form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  border-radius: 0;
}

.input-group > .form-control:not(:first-child):not(:last-child),
.input-group > select.form-control:not(:first-child):not(:last-child) {
  border-radius: 0;
}

.input-group > .form-control:last-child,
.input-group > select.form-control:last-child {
  border-radius: 0 6px 6px 0;
}

.input-group > .form-control:first-child,
.input-group > select.form-control:first-child {
  border-radius: 6px 0 0 6px;
}

.input-group > .select2-container {
  flex: 1 1 auto;
  width: 1% !important;
  min-width: 0 !important;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-group-justified {
  display: flex;
  width: 100%;
}
.btn-group-justified > .btn,
.btn-group-justified > .btn-group {
  flex: 1 1 0;
}

.form-control {
  height: 34px;
  padding: 6px 12px;
  font-size: 0.875rem;
  line-height: 1.42857143;
}

textarea.form-control,
select.form-control[multiple],
select.form-control[size]:not([size="1"]) {
  height: auto;
  min-height: 34px;
}

.select2-container--default .select2-selection--single {
  height: 34px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 32px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 32px !important;
}

.datepicker,
.daterangepicker {
  z-index: 2100 !important;
}

/*
 * daterangepicker embed (opens: "embed"):
 * - BS5 .input-group é flex e empilhava os meses
 * - width % esticava as células
 * - em colunas estreitas (consumo/periodo) usa zoom como no ALTE2
 */
.date-embed-host,
.input-group.date:has(> .daterangepicker.opensembed),
.date:has(> .daterangepicker.opensembed) {
  display: block !important;
  width: 100%;
  flex-wrap: unset;
  container-type: inline-size;
  container-name: date-embed;
}
.col-md-4 .date-embed-host,
.col-lg-4 .date-embed-host,
.col-sm-4 .date-embed-host {
  max-width: 100%;
}
.daterangepicker.opensembed {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  float: none !important;
  display: block !important;
  width: max-content !important;
  max-width: none !important;
  margin-top: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(18, 39, 57, 0.12) !important;
  border-radius: 8px;
  box-shadow: none !important;
  background: #fff;
  z-index: auto !important;
  overflow: hidden;
}
.daterangepicker.opensembed::before,
.daterangepicker.opensembed::after {
  display: none !important;
}
.daterangepicker.opensembed > .calendar {
  float: left !important;
  display: block !important;
  width: 278px !important;
  max-width: 278px !important;
  box-sizing: border-box;
  padding: 8px !important;
}
.daterangepicker.opensembed > .calendar.left {
  border-right: 1px solid rgba(18, 39, 57, 0.08);
}
.daterangepicker.opensembed > .ranges {
  float: left !important;
}
.daterangepicker.opensembed > .drp-buttons {
  clear: both;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  width: auto;
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid rgba(18, 39, 57, 0.08);
}
.daterangepicker.opensembed .drp-selected {
  margin-right: auto;
  padding-right: 8px;
}
.daterangepicker.opensembed .calendar-table {
  background: transparent;
}
.daterangepicker.opensembed .calendar-table table {
  width: 100%;
  table-layout: fixed;
}
.daterangepicker.opensembed .calendar-table th,
.daterangepicker.opensembed .calendar-table td {
  min-width: 0;
  width: auto;
  height: 28px;
  line-height: 28px;
  font-size: 12px;
}

/*
 * Coluna estreita: escala o picker (~556px) para caber no host.
 * Divisor 620px dá folga de borda/padding do card Filtros.
 */
.col-md-4 .daterangepicker.opensembed,
.col-lg-4 .daterangepicker.opensembed,
.col-sm-4 .daterangepicker.opensembed {
  zoom: 0.75;
}
.sidebar-collapse .col-md-4 .daterangepicker.opensembed,
.sidebar-collapse .col-lg-4 .daterangepicker.opensembed {
  zoom: 0.82;
}
@media (min-width: 1500px) {
  .col-md-4 .daterangepicker.opensembed,
  .col-lg-4 .daterangepicker.opensembed {
    zoom: 0.82;
  }
  .sidebar-collapse .col-md-4 .daterangepicker.opensembed,
  .sidebar-collapse .col-lg-4 .daterangepicker.opensembed {
    zoom: 0.88;
  }
}
@container date-embed (max-width: 700px) {
  .date-embed-host .daterangepicker.opensembed,
  .col-md-4 .daterangepicker.opensembed,
  .col-lg-4 .daterangepicker.opensembed,
  .col-sm-4 .daterangepicker.opensembed {
    zoom: min(0.95, calc(100cqw / 620px));
  }
  .daterangepicker.opensembed .calendar-table th,
  .daterangepicker.opensembed .calendar-table td {
    font-size: 14px;
  }
}
/* Addon BS3 + form-control: cantos internos sem radius */
.input-group:not(:has(> .form-control:first-child)):not(:has(> .daterangepicker)) > .input-group-addon:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}
.input-group > .input-group-addon + .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group > .form-control + .input-group-addon {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.select2-container--open {
  z-index: 2200 !important;
}
.modal {
  z-index: 2000;
}
.modal-backdrop {
  z-index: 1990;
}

.label {
  display: inline-block;
  padding: 0.25em 0.65em;
  font-size: 75%;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 999px;
}

.label-default { background-color: #6c757d; }
.label-primary { background-color: #122739 !important; }
.label-success { background-color: #1e7f4f !important; }
.label-info { background-color: #5c6b7a !important; }
.label-warning { background-color: #d97706 !important; }
.label-danger { background-color: #da0020 !important; }

.close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.5;
  background: transparent;
  border: 0;
  padding: 0;
}
.close:hover { opacity: 0.8; }

.panel {
  margin-bottom: 1rem;
  background-color: #fff;
  border: 1px solid rgba(18, 39, 57, 0.08);
  border-radius: 10px;
}
.panel-body { padding: 15px; }
.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid rgba(18, 39, 57, 0.08);
}
.panel-footer {
  padding: 10px 15px;
  border-top: 1px solid rgba(18, 39, 57, 0.08);
}

.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f7f9fb;
  border: 1px solid rgba(18, 39, 57, 0.08);
  border-radius: 10px;
}

.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Card de perfil da instalação (resumo) — AdminLTE 2 */
.box-profile {
  text-align: center;
}
.box-profile .profile-user-img {
  display: block;
  margin: 0 auto 8px;
  width: 100px;
  height: 100px;
  max-width: 100px;
  padding: 3px;
  border: 3px solid #d2d6de;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #fff;
}
.box-profile .profile-username {
  font-size: 21px;
  margin-top: 5px;
  margin-bottom: 12px;
}
.list-group-unbordered {
  text-align: left;
  margin-bottom: 0;
}
.list-group-unbordered > .list-group-item {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  background: transparent;
}
.list-group-unbordered > .list-group-item > .pull-right {
  float: right;
}

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px dashed;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* AdminLTE 2 box → card visual no Bootstrap 5 */
.box {
  position: relative;
  background: #fff;
  border: 1px solid rgba(18, 39, 57, 0.08);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(18, 39, 57, 0.05);
  margin-bottom: 1rem;
  width: 100%;
}
.box-header {
  display: block;
  padding: 12px 16px;
  position: relative;
  color: #1c2834;
}
.box-header.with-border {
  border-bottom: 1px solid rgba(18, 39, 57, 0.08);
}
.box-title {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}
.box-body { padding: 16px; }
.box-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(18, 39, 57, 0.08);
  background: transparent;
  border-radius: 0 0 10px 10px;
}
.box-tools { position: absolute; right: 10px; top: 8px; }
.box.box-primary { border-top: 3px solid #122739; }
.box.box-info { border-top: 3px solid #5c6b7a; }
.box.box-success { border-top: 3px solid #1e7f4f; }
.box.box-warning { border-top: 3px solid #d97706; }
.box.box-danger { border-top: 1px solid rgba(18, 39, 57, 0.08); }
.box.box-default { border-top: 3px solid #d2d6de; }
.box.box-solid { border-top-width: 0; }
.box.box-solid.box-primary > .box-header { background: #122739; color: #fff; }
.box.box-solid.box-danger > .box-header { background: #da0020; color: #fff; }
.box.box-solid.box-success > .box-header { background: #1e7f4f; color: #fff; }
.box.box-solid.box-info > .box-header { background: #5c6b7a; color: #fff; }
.box.box-solid.box-warning > .box-header { background: #d97706; color: #fff; }
.no-padding { padding: 0 !important; }

.content-header {
  padding: 1rem 0 0.5rem;
}
.content-header > h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}
.content-header > h1 > small {
  font-size: 0.9rem;
  font-weight: 400;
  color: #5c6b7a;
  padding-left: 0.35rem;
}
.content {
  padding: 0.75rem 0 1.5rem;
}

.small-box {
  border-radius: 10px;
  position: relative;
  display: block;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(18, 39, 57, 0.08);
  overflow: hidden;
  color: #fff;
}
.small-box > .inner { padding: 16px; }
.small-box h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 10px;
}
.small-box p { margin: 0; font-weight: 600; }
.small-box .icon {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 72px;
  opacity: 0.18;
}
.small-box > .small-box-footer {
  display: block;
  padding: 6px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.info-box {
  display: block;
  min-height: 88px;
  background: #fff;
  width: 100%;
  box-shadow: 0 1px 2px rgba(18, 39, 57, 0.05);
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid rgba(18, 39, 57, 0.08);
}
.info-box-icon {
  display: block;
  float: left;
  height: 88px;
  width: 88px;
  text-align: center;
  font-size: 2rem;
  line-height: 88px;
  border-radius: 10px 0 0 10px;
  color: #fff;
}
.info-box-content {
  padding: 12px 14px;
  margin-left: 88px;
}
.info-box-text {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #5c6b7a;
}
.info-box-number {
  display: block;
  font-weight: 700;
  font-size: 1.35rem;
}

.bg-aqua,
.bg-light-blue,
.bg-blue { background-color: #122739 !important; color: #fff !important; }
.bg-red { background-color: #da0020 !important; color: #fff !important; }
.bg-green { background-color: #1e7f4f !important; color: #fff !important; }
.bg-yellow { background-color: #d97706 !important; color: #fff !important; }
.bg-navy { background-color: #122739 !important; color: #fff !important; }

.nav-tabs-custom {
  background: #fff;
  border: 1px solid rgba(18, 39, 57, 0.08);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.nav-tabs-custom > .nav-tabs {
  border-bottom: 1px solid rgba(18, 39, 57, 0.08);
  margin: 0;
  padding: 0 0.5rem;
}
.nav-tabs-custom > .nav-tabs > li > a {
  border: 0;
  border-top: 3px solid transparent;
  border-radius: 0;
  color: #444;
  margin: 0;
}
.nav-tabs-custom > .nav-tabs > li.active > a,
.nav-tabs-custom > .nav-tabs > li.active > a:hover {
  border-top-color: #da0020;
  background: #fff;
  color: #1c2834;
}
.nav-tabs-custom > .tab-content { padding: 14px 16px; }

.btn-box-tool {
  padding: 5px;
  font-size: 12px;
  background: transparent;
  color: #8a97a6;
  border: 0;
}
.btn-box-tool:hover {
  color: #122739;
  background: rgba(18, 39, 57, 0.06);
}

.table > thead > tr > th {
  background: #f7f9fb;
  font-weight: 600;
}

.alert h4 { margin-top: 0; font-weight: 600; }
.alert .icon { margin-right: 6px; }
.alert.alert-dismissible {
  padding-right: 2.5rem;
  position: relative;
}
.alert .btn-close,
.alert .close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
}
.alert .close {
  background: transparent;
  border: 0;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.55;
  padding: 0;
}

.callout {
  border-radius: 10px;
  margin: 0 0 1rem;
  padding: 15px;
  border-left: 4px solid #eee;
}
.callout.callout-info {
  background: #eef3f8;
  border-left-color: #122739;
}
.callout.callout-danger {
  background: #fde8eb;
  border-left-color: #da0020;
}
.callout.callout-success {
  background: #e8f6ee;
  border-left-color: #1e7f4f;
}
.callout.callout-warning {
  background: #fff6e8;
  border-left-color: #d97706;
}

.direct-chat-contacts,
.direct-chat-messages { /* reserved */ }

/* Markup BS3: close vem antes do título — no flex do BS5 precisa de order */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}
.modal-header .modal-title {
  order: 1;
  flex: 1 1 auto;
  margin: 0;
}
.modal-header .close,
.modal-header .btn-close {
  order: 2;
  margin-left: 0.25rem;
  margin-right: 0;
}

/* Utilitário BS3 removido no BS5 */
.hidden {
  display: none !important;
}

/* grid row still needs flex in BS5 */
.row::before,
.row::after { display: none; content: none; }

/* Cores de texto do AdminLTE 2 (bandeiras, status, etc.) */
.text-red { color: #dd4b39 !important; }
.text-yellow { color: #f39c12 !important; }
.text-aqua { color: #00c0ef !important; }
.text-blue { color: #0073b7 !important; }
.text-black { color: #111111 !important; }
.text-light-blue { color: #3c8dbc !important; }
.text-green { color: #00a65a !important; }
.text-gray { color: #d2d6de !important; }
.text-navy { color: #001f3f !important; }
.text-teal { color: #39cccc !important; }
.text-olive { color: #3d9970 !important; }
.text-lime { color: #01ff70 !important; }
.text-orange { color: #ff851b !important; }
.text-fuchsia { color: #f012be !important; }
.text-purple { color: #605ca8 !important; }
.text-maroon { color: #d81b60 !important; }

.box.collapsed-box > .box-body,
.box.collapsed-box > .box-footer {
  display: none;
}

.img-circle {
  border-radius: 50%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* DataTables 1.10 sob Bootstrap 5 — controles, paginação e rodapé */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  white-space: nowrap;
  margin-bottom: 0;
}
.dataTables_wrapper .dataTables_length select {
  display: inline-block;
  width: auto;
  min-width: 4.5rem;
}
.dataTables_wrapper .dataTables_filter input {
  display: inline-block;
  width: auto;
  margin-left: 0.35rem;
}
.dataTables_wrapper .dataTables_filter {
  text-align: right;
}
.dataTables_wrapper .dataTables_paginate {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}
.dataTables_wrapper .dataTables_paginate ul.pagination {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 2px 0;
  padding-left: 0;
  list-style: none;
}
.dataTables_wrapper .dataTables_info {
  padding-top: 0.55rem;
  white-space: nowrap;
  color: #6c757d;
}
.dataTables_wrapper .row {
  --bs-gutter-x: 1rem;
  margin-bottom: 0.35rem;
}
/* Fallback se o renderer antigo (sem page-link) ainda aparecer */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-block;
  box-sizing: border-box;
  min-width: 2rem;
  padding: 0.375rem 0.75rem;
  margin-left: -1px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none !important;
  color: #122739;
  background-color: #fff;
  border: 1px solid rgba(18, 39, 57, 0.16);
  cursor: pointer;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  color: #fff;
  background-color: #122739;
  border-color: #122739;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  color: #adb5bd;
  background-color: #fff;
  border-color: rgba(18, 39, 57, 0.12);
  cursor: default;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
  background-color: rgba(18, 39, 57, 0.06);
  color: #122739;
}
.dataTables_wrapper .dataTables_paginate span > .paginate_button:first-child {
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}
.dataTables_wrapper .pagination .page-link {
  color: #122739;
  border-color: rgba(18, 39, 57, 0.16);
}
.dataTables_wrapper .pagination .page-item.active .page-link {
  color: #fff;
  background-color: #122739;
  border-color: #122739;
}
.dataTables_wrapper .pagination .page-item.disabled .page-link {
  color: #adb5bd;
}

/* Modal BS5 com markup antigo */
.modal.fade .modal-dialog {
  transition: transform 0.2s ease-out;
}
.modal.fade.show {
  opacity: 1 !important;
}
.modal.show {
  opacity: 1 !important;
}
.modal-backdrop.show {
  opacity: 0.5;
}
