/*
 * Ajustes de widgets do change form / inlines:
 * - Ícones nativos Django 6 (relacionados, calendário): menores (~13px)
 * - Botões customizados btn_* (cobrança, NFSe, etc.): btn-sm Bootstrap (~32px)
 */

/* --- Widgets nativos: relacionados (editar, adicionar, excluir, ver) --- */

#content-main .related-widget-wrapper {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0 4px;
}

#content-main .related-widget-wrapper-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
}

#content-main .related-widget-wrapper-link img {
  width: 13px;
  height: 13px;
  display: block;
}

/* --- Widgets nativos: calendário e relógio --- */

#content-main .datetimeshortcuts .clock-icon,
#content-main .datetimeshortcuts .date-icon {
  width: 13px;
  height: 13px;
  background-size: 13px auto;
}

#content-main .datetimeshortcuts a:focus .clock-icon,
#content-main .datetimeshortcuts a:hover .clock-icon {
  background-position: 0 -13px;
}

#content-main .datetimeshortcuts a:focus .date-icon,
#content-main .datetimeshortcuts a:hover .date-icon {
  background-position: 0 -13px;
}

#content-main .datetimeshortcuts {
  line-height: 1.2;
  font-size: 0.6875rem;
}

#content-main .datetimeshortcuts a {
  font-size: inherit;
}

.inline-group .tabular td .datetimeshortcuts,
.inline-group .tabular td .datetimeshortcuts a {
  font-size: 0.6875rem;
}

/* --- Botões de ação customizados (btn_*) nos inlines --- */

.inline-group .tabular tr.has_original td[class*="field-btn_"] {
  padding-top: 2em;
  vertical-align: top;
}

.inline-group table td[class*="field-btn_"] {
  width: 1%;
  white-space: nowrap;
  vertical-align: top;
  padding: 8px 6px;
  text-align: center;
}

.inline-group table td[class*="field-btn_"] p {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.inline-group table th[class*="column-btn_"] {
  width: 1%;
  white-space: nowrap;
  padding: 8px 6px;
  text-align: center;
}

.inline-group table td[class*="field-btn_"] .btn,
.inline-group table td[class*="field-btn_"] a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 0.2rem;
  cursor: pointer;
  text-decoration: none;
  vertical-align: top;
  box-sizing: border-box;
  background-image: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.inline-group table td[class*="field-btn_"] .btn i,
.inline-group table td[class*="field-btn_"] a.btn i {
  font-size: 0.875rem;
  line-height: 1;
  pointer-events: none;
}

.inline-group table td[class*="field-btn_"] .btn.btn-primary,
.inline-group table td[class*="field-btn_"] a.btn.btn-primary {
  color: #fff !important;
  background-color: #007bff !important;
  border-color: #007bff !important;
}

.inline-group table td[class*="field-btn_"] .btn.btn-secondary,
.inline-group table td[class*="field-btn_"] a.btn.btn-secondary {
  color: #fff !important;
  background-color: #6c757d !important;
  border-color: #6c757d !important;
}

.inline-group table td[class*="field-btn_"] .btn.btn-success,
.inline-group table td[class*="field-btn_"] a.btn.btn-success {
  color: #fff !important;
  background-color: #28a745 !important;
  border-color: #28a745 !important;
}

.inline-group table td[class*="field-btn_"] .btn.btn-danger,
.inline-group table td[class*="field-btn_"] a.btn.btn-danger {
  color: #fff !important;
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
}

.inline-group table td[class*="field-btn_"] .btn.btn-warning,
.inline-group table td[class*="field-btn_"] a.btn.btn-warning {
  color: #1f2d3d !important;
  background-color: #ffc107 !important;
  border-color: #ffc107 !important;
}

.inline-group table td[class*="field-btn_"] .btn.btn-info,
.inline-group table td[class*="field-btn_"] a.btn.btn-info {
  color: #fff !important;
  background-color: #17a2b8 !important;
  border-color: #17a2b8 !important;
}

.inline-group table td[class*="field-btn_"] .btn.btn-dark,
.inline-group table td[class*="field-btn_"] a.btn.btn-dark {
  color: #fff !important;
  background-color: #343a40 !important;
  border-color: #343a40 !important;
}

.inline-group table td[class*="field-btn_"] .btn:hover,
.inline-group table td[class*="field-btn_"] a.btn:hover {
  filter: brightness(0.92);
}

.inline-group table td[class*="field-btn_"] .btn:focus,
.inline-group table td[class*="field-btn_"] a.btn:focus {
  outline: 1px solid var(--primary, #417690);
  outline-offset: 0;
}
