/* Cambiar el color de fondo de la barra lateral */
@font-face {
  font-family: 'Futura';
  src: url('../fonts/futura.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

.readonly-field {
  background-color: #ececec !important;
  /* Fondo gris claro para el campo deshabilitado */
  color: #848484 !important;
  /* Color de texto gris */
  cursor: not-allowed;
  /* Cambia el puntero a 'no permitido' */
  pointer-events: none;
  /* Desactiva eventos de mouse, haciendo que parezca completamente deshabilitado */
  opacity: 1;
  /* El campo es completamente opaco */
}

.select2-container.disabled-field .select2-selection {
  background-color: #eee !important;
  /* Fondo gris claro para el campo deshabilitado */
  color: #848484 !important;
  cursor: not-allowed;
  /* Cambia el puntero a 'no permitido' */
  pointer-events: none;
  /* Desactiva eventos de mouse, haciendo que parezca completamente deshabilitado */
  border: 1px solid #ced4da;
}


.disabled-field {
  background-color: #dbdbdb !important;
  /* Color de fondo para indicar que está deshabilitado */
  color: #888686 !important;
  /* Color de texto */
  cursor: not-allowed !important;
  /* Cambia el puntero a 'no permitido' */
  pointer-events: none !important;
  opacity: 1;
  user-select: none;
}

.disabled-field>span {
  background-color: #dbdbdb !important;
  /* Color de fondo para indicar que está deshabilitado */
  color: #888686 !important;
  /* Color de texto */
  cursor: not-allowed !important;
  /* Cambia el puntero a 'no permitido' */
  pointer-events: none !important;
  opacity: 1;
  user-select: none;
}

.bg-certiffy-primary {
  background-color: #0e1e3f !important;
}


#jazzy-actions .object-tools a[href*="/history/"] {
  display: none;
}

.layout-navbar-fixed .wrapper .sidebar-dark-warning .brand-link:not([class*="navbar"]) {
  background-color: #0e1e3f !important;
}

.main-sidebar {
  background-color: #0e1e3f !important;
}

/* Cambiar el color del texto de los enlaces de la barra lateral */
.main-sidebar a {
  color: #ffffff !important;

}

/* Cambiar el color de los enlaces activos en la barra lateral */
.main-sidebar .active a {
  background-color: #0e1e3f !important;
  color: #ffffff !important;
}

/* Estilo global para todos los botones de agregar inlines */
.inline-group1 .add-row {
  background-color: #bebebe;
  /* Cambia esto al color que desees */
  color: #3884a5;
  /* Color del texto */
  border: 1px solid transparent;
  /* Borde */
  border-radius: 0.25rem;
  /* Bordes redondeados */
  padding: 0.375rem 0.75rem;
  /* Espaciado interno */
  text-align: center;
  /* Alineación del texto */
  text-decoration: none;
  /* Sin subrayado */
  display: inline-block;
  /* Mostrar como bloque en línea */
  font-weight: 500;
  /* Peso del texto */
  cursor: pointer;
  /* Cambia el cursor al pasar sobre él */
}

.inline-group1 .add-row:hover {
  background-color: #0056b3;
  /* Color de fondo al pasar el mouse */
  color: #fff;
  /* Color del texto al pasar el mouse */
  text-decoration: none;
  /* Sin subrayado al pasar el mouse */
}

body.jazzmin-login-page {
  background-color: #0e1e3f !important;
}

.login-logo>h1>picture>img {
  width: 250px !important;
}

.brand-link .brand-image {
  opacity: 1 !important;
}


[class*=sidebar-dark-] .nav-treeview>.nav-item>.nav-link.active,
[class*=sidebar-dark-] .nav-treeview>.nav-item>.nav-link.active:focus,
[class*=sidebar-dark-] .nav-treeview>.nav-item>.nav-link.active:hover {
  background-color: #eba907 !important;
  color: #FFF;
}

[class*=sidebar-dark-] .nav-sidebar>.nav-item.menu-open>.nav-link,
[class*=sidebar-dark-] .nav-sidebar>.nav-item:hover>.nav-link,
[class*=sidebar-dark-] .nav-sidebar>.nav-item>.nav-link:focus {
  background-color: #eba907 !important;
  color: #fff;
}

#jazzy-logo>.brand-text {
  color: #ffc107 !important;
}

footer.main-footer .float-right {
  display: none !important;
}

.btn-success {
  background-color: #4daf50 !important;
  border-color: #4daf50 !important;
}

.btn-success:hover {
  background-color: #338337 !important;
  border-color: #338337 !important;
}

.btn-info {
  background-color: #0e1e3f !important;
  border-color: #0e1e3f !important;
}

.btn-info:hover {
  background-color: #183670 !important;
  border-color: #183670 !important;
}

.add-row>a.float-right {
  margin-top: 15px;
  color: #FFF !important;
  background-color: #0e1e3f !important;
  border-color: #0e1e3f !important;
}

.add-row>a.float-right:hover {
  background-color: #183670 !important;
  border-color: #183670 !important;
}

.djn-add-item>.add-handler {
  color: #FFF !important;
  background-color: #0e1e3f !important;
  border-color: #0e1e3f !important;
}

.djn-add-item>.add-handler:hover {
  background-color: #183670 !important;
  border-color: #183670 !important;
}

.accent-primary .nav-tabs .nav-link {
  color: #0e1e3f !important;
}

.accent-primary .nav-tabs .nav-link:hover {
  background-color: rgba(14, 30, 63, 0.06);
  color: #0e1e3f !important;
}

.nav-tabs {
  border-bottom: 1px solid rgba(14, 30, 63, 0.15) !important;
}

.add-row>td>.btn-default {
  background-color: #0e1e3f !important;
  border-color: #0e1e3f !important;
  color: #FFF !important;
}

.add-row>td>.btn-default:hover {
  background-color: #183670 !important;
  border-color: #183670 !important;
}

.accent-primary a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):not(.page-link):not(.btn) {
  color: #0e1e3f;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #0e1e3f !important;
  border: 1px solid #ffc107 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  color: #fff !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  border-right: 1px solid #ffc107 !important;
  color: #FFF !important;
  margin-left: 0 !important;

  &:hover {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    background-color: #eba907 !important;
    color: #0e1e3f !important;
  }
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  padding-left: 7px !important;
}

.main-footer .float-right {
  display: none !important;
}

.card-title {
  padding-top: 15px;
}

table.djn-items {
  background-color: #f4f4f4 !important;
}

/* Tablas del changelist: diseño institucional uniforme */
#changelist table thead th,
#changelist .table thead th,
#result_list thead th {
  background-color: #0e1e3f !important;
  color: #fff !important;
  border-color: #eba907 !important;
  border-bottom: 2px solid #eba907 !important;
  font-weight: 300 !important;
  padding: 0.75rem !important;
  text-align: center !important;
  vertical-align: middle !important;
}

#changelist table thead th a,
#changelist .table thead th a,
#result_list thead th a {
  color: #ffc107 !important;
}

#changelist table thead th a:hover,
#changelist .table thead th a:hover,
#result_list thead th a:hover {
  color: #eba907 !important;
}

#changelist table tbody td,
#changelist .table tbody td,
#result_list tbody td {
  padding: 0.6rem 0.75rem !important;
  vertical-align: middle !important;
}

#changelist table tbody tr:hover,
#changelist .table tbody tr:hover,
#result_list tbody tr:hover {
  background-color: rgba(14, 30, 63, 0.08) !important;
}

#changelist table tbody tr:nth-child(even),
#changelist .table tbody tr:nth-child(even),
#result_list tbody tr:nth-child(even) {
  background-color: rgba(14, 30, 63, 0.03) !important;
}


#changelist table tbody a:not(.btn),
#changelist .table tbody a:not(.btn),
#result_list tbody a:not(.btn) {
  color: #0e1e3f !important;
}

#changelist table tbody a:not(.btn):hover,
#changelist .table tbody a:not(.btn):hover,
#result_list tbody a:not(.btn):hover {
  color: #0e1e3f !important;
}

#changelist table,
#changelist .table,
#result_list {
  border: 1px solid rgba(14, 30, 63, 0.15) !important;
  border-radius: 0.35rem !important;
  overflow: hidden !important;
}

.inline-related>fieldset.djn-fieldset {
  background-color: #f4f4f4 !important;
}

body {
  font-family: "Futura", serif !important;
}

label:not(.form-check-label):not(.custom-file-label) {
  font-weight: normal !important;
}

/* Formularios: toques sutiles institucionales (plataforma general) */
.form-control:focus,
.form-select:focus,
select.form-control:focus,
input.form-control:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
textarea.form-control:focus,
textarea:focus {
  border-color: rgba(14, 30, 63, 0.45) !important;
  box-shadow: 0 0 0 0.2rem rgba(14, 30, 63, 0.12) !important;
}

.form-group label,
.form-row label,
.module label,
.card-body label,
.inline-related label,
fieldset label {
  color: #2c3e50 !important;
}

.card-header,
.card-header h2,
.module h2,
.module caption,
.collapse h2,
.inline-group h2,
.inline-related h3 {
  color: #0e1e3f !important;
  /* border-left: 3px solid rgba(14, 30, 63, 0.25) !important; # Este lo quite pq ensucia los inlines anidados */
  padding-left: 0.5rem !important;
}

/* Pestañas/cabeceras de inlines: diseño institucional sutil */
.djn-inline-form .card-header,
.inline-related .card-header,
.djn-module .card-header,
.inline-group .card-header {
  background-color: rgba(14, 30, 63, 0.06) !important;
  border-bottom: 1px solid rgba(14, 30, 63, 0.12) !important;
  border-left: 3px solid rgba(235, 169, 7, 0.5) !important;
  padding: 0.6rem 1rem !important;
}


/* Cabeceras de tablas en inlines tabulares */
.djn-thead th,
.djn-group .djn-thead th {
  background-color: rgba(14, 30, 63, 0.08) !important;
  color: #0e1e3f !important;
  border-bottom: 1px solid rgba(235, 169, 7, 0.4) !important;
  font-weight: 300 !important;
  padding: 0.5rem 0.75rem !important;
}

.djn-inline-form .card-header .card-title,
.inline-related .card-header .card-title {
  color: #0e1e3f !important;
  font-weight: 600 !important;
}

.djn-inline-form .card-header a,
.inline-related .card-header a {
  color: #0e1e3f !important;
}

.djn-inline-form .card-header a:hover,
.inline-related .card-header a:hover {
  color: #0e1e3f !important;
}

/* Tabs Bootstrap en formularios (nav-tabs) */
.nav-tabs .nav-link {
  color: #0e1e3f !important;
  border-color: transparent transparent rgba(14, 30, 63, 0.15) !important;
}

.nav-tabs .nav-link:hover {
  border-color: transparent transparent rgba(14, 30, 63, 0.25) !important;
  color: #0e1e3f !important;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link.active:hover {
  background-color: #0e1e3f !important;
  border-color: #0e1e3f #0e1e3f transparent !important;
  color: #fff !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: rgba(14, 30, 63, 0.45) !important;
  box-shadow: 0 0 0 0.2rem rgba(14, 30, 63, 0.1) !important;
}

.storehouse-button-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
}

.fade-in {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

select[disabled]+.select2 .select2-selection__rendered {
  color: #848484 !important;
}

.canceled {
  background: red;
  color: #FFF;
  padding: 5px;
}

.asteriskField {
  color: #dc3545 !important;
}

.swal-wide {
  width: 80% !important;
}

/* SweetAlert2 modal: diseño institucional (azul y amarillo) */
.swal-modal-institucional.swal2-popup {
  border: 2px solid #eba907 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 0.5rem 1rem rgba(14, 30, 63, 0.25) !important;
  padding: 0 !important;
}

.swal-modal-institucional .swal2-header {
  background-color: #0e1e3f !important;
  padding: 1rem 2.5rem 1rem 1.5rem !important;
  margin: 0 !important;
  border-bottom: 2px solid #eba907 !important;
  border-radius: 0.5rem 0.5rem 0 0 !important;
}

.swal-modal-institucional .swal2-title {
  color: #0e1e3f !important;
  font-weight: 600 !important;
}

.swal-modal-institucional .swal2-title a,
.swal-modal-institucional .swal-print-link {
  color: #ffc107 !important;
  margin-left: 0.5rem;
}

.swal-modal-institucional .swal2-title a:hover,
.swal-modal-institucional .swal-print-link:hover {
  color: #eba907 !important;
}

.swal-modal-institucional .swal2-html-container {
  padding: 1rem !important;
}

.swal-modal-institucional .table-modal-content a,
.swal-modal-institucional table a {
  color: #0e1e3f !important;
}

.swal-modal-institucional .table-modal-content a:hover,
.swal-modal-institucional table a:hover {
  color: #0e1e3f !important;
}

.swal-modal-institucional .swal2-close {
  color: #ffc107 !important;
  font-size: 1.75rem !important;
  top: 0.75rem !important;
  right: 0.75rem !important;
}

.swal-modal-institucional .swal2-close:hover {
  color: #eba907 !important;
}

.swal-modal-institucional .swal2-close:focus {
  box-shadow: 0 0 0 2px rgba(235, 169, 7, 0.5) !important;
}

#balance-summary {
  position: fixed;
  bottom: 25px;
  right: 20px;
  z-index: 9999;
  background: #f5f5f5;
  padding: 15px 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  min-width: 160px;
}

#balance-summary strong {
  display: flex;
}

.select2-container.readonly-select2-wrapper .select2-selection {
  background-color: #ececec !important;
  /* Fondo gris claro para el campo deshabilitado */
  color: #848484 !important;
  cursor: not-allowed;
  /* Cambia el puntero a 'no permitido' */
  pointer-events: none;
  /* Desactiva eventos de mouse, haciendo que parezca completamente deshabilitado */
  border: 1px solid #ced4da;
}

/* Ensure select2 controls are responsive within form rows */
.form-group .select2-container,
.form-group .select2-container--default {
  width: 100% !important;
  max-width: 100% !important;
}

.form-group .select2-container .select2-selection {
  width: 100% !important;
}

/* Related widget wrapper layout to keep select + buttons responsive */
.related-widget-wrapper {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
}


.related-widget-wrapper .select2-container .select2-selection {
  width: 100% !important;
}

.related-widget-wrapper .related-widget-wrapper-link {
  flex: 0 0 auto;
}

@media (max-width: 576px) {
  .related-widget-wrapper {
    flex-wrap: wrap;
  }

  .related-widget-wrapper .select2-container,
  .related-widget-wrapper .select2-container--default {
    flex: 1 1 240px;
    min-width: 0;
    max-width: 100%;
  }
}

.toggle-btn {
  background: #e0e0e0;
  border: none;
  cursor: pointer;
  font-weight: 400;
  transition: background 0.3s;
  margin: 0 10px 0 0;
}

.toggle-btn:hover {
  background: #c1c0c0;
}

.toggle-btn:active {
  background: #c1c0c0;
}

#change-list-filters {
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

#change-list-filters.collapsed {
  display: none;
  opacity: 0;
}

#change-list-filters.expanded {
  display: block;
  max-height: 500px;
  opacity: 1;
}

/* Apariencia de solo lectura */
.readonly-field+.select2 .select2-selection {
  background: #f5f5f5;
  cursor: not-allowed;
}

.readonly-field+.select2 .select2-selection span {
  color: #848484 !important;
}

.readonly-field+.select2 .select2-selection__arrow {
  opacity: 0.4;
}

input.readonly-field,
textarea.readonly-field {
  background: #f5f5f5 !important;
  cursor: not-allowed;
}

.accent-primary .page-item.active .page-link,
.accent-primary .page-item.active a {
  background-color: #ffc107;
  border-color: #0e1e3f;
  color: #0e1e3f;
}

.accent-primary .page-item .page-link {
  color: #fff;
}

.page-link {
  position: relative;
  display: block;
  padding: .5rem .75rem;
  margin-left: 0;
  line-height: 1.25;
  color: #fff;
  background-color: #0e1e3f;
  border: 0 solid transparent;
}

.page-link:hover {
  background-color: #223c70;
}

/* ============================================
   Tablas de inlines PartnersBatch - Diseño institucional
   (.pd-wrapper usado en batch_profit_summary, batch_packing_packages,
    batch_product_purchase_orders, batch_supplies_fifo_cost,
    batch_harvest_crew_purchase_orders, batch_service_orders_allocated,
    batch_shipment_orders_closed)
   ============================================ */
.pd-wrapper .pd-table thead th,
.pd-wrapper .pd-table-header {
  background-color: #0e1e3f !important;
  color: #fff !important;
  border-bottom: 1px solid #eba907 !important;
  border-right: 1px solid rgba(235, 169, 7, 0.3);
  font-weight: 300 !important;
  padding: 0.5rem 0.75rem !important;
  text-align: left !important;
  vertical-align: middle !important;
}

.pd-wrapper .pd-table-wrap {
  border: 1px solid rgba(235, 169, 7, 0.4) !important;
  border-radius: 8px;
}

.pd-wrapper .pd-report-head {
  background: rgba(14, 30, 63, 0.08) !important;
  border: 1px solid #eba907 !important;
  border-left: 4px solid #0e1e3f !important;
}

.pd-wrapper .pd-report-head b {
  color: #0e1e3f !important;
}

.pd-wrapper .pd-section {
  border-color: rgba(235, 169, 7, 0.25) !important;
}

.pd-wrapper .pd-h2 {
  color: #0e1e3f !important;
}

.pd-wrapper .pd-chip {
  border-color: rgba(14, 30, 63, 0.2) !important;
}

.pd-wrapper .pd-chip b {
  color: #0e1e3f !important;
}

.pd-wrapper .pd-link {
  color: #0e1e3f !important;
}

.pd-wrapper .pd-link:hover {
  color: #eba907 !important;
}

.pd-wrapper .pd-progress>span {
  background: linear-gradient(90deg, #0e1e3f, #223c70) !important;
}

.pd-wrapper .pd-badge {
  background: rgba(14, 30, 63, 0.08) !important;
  color: #0e1e3f !important;
  border: 1px solid rgba(235, 169, 7, 0.4) !important;
}

.pd-wrapper .pd-table tbody tr:hover {
  background: rgba(235, 169, 7, 0.06) !important;
}

/* Flatpickr - Calendario institucional */
.flatpickr-calendar {
  border: 1px solid #eba907;
  box-shadow: 0 4px 12px rgba(14, 30, 63, 0.15);
}

.flatpickr-months .flatpickr-month {
  background: #0e1e3f;
  color: #fff;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month .numInputWrapper {
  color: #fff;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month .numInputWrapper:hover {
  background: rgba(255, 255, 255, 0.1);
}

.flatpickr-weekdays span.flatpickr-weekday {
  color: #0e1e3f;
  font-weight: 600;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #0e1e3f;
  border-color: #0e1e3f;
}

.flatpickr-day:hover {
  background: #eba907;
  border-color: #eba907;
  color: #0e1e3f;
}

.flatpickr-day.today {
  border-color: #eba907;
}

.flatpickr-day.today:hover {
  background: #eba907;
  color: #0e1e3f;
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
  fill: #eba907;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover {
  background: rgba(14, 30, 63, 0.05);
}

.flatpickr-input[readonly] {
  cursor: pointer;
}

.dj_map {
  width: 100%;
  min-width: 600px;
  min-height: 400px;
  height: 400px !important;
  border: 1px solid #ccc;
}

.content {
  padding: 0.2rem !important;
}


@media (min-width: 768px) {
  .form-group .row>.field-geom.col-sm-7 {
    flex: 0 0 75% !important;
    max-width: 75% !important;
  }
}

/* Elimina el padding y borde del contenedor raíz de formsets anidados */
.djn-group-root>.js-inline-admin-formset,
.djn-group-root>details>.js-inline-admin-formset,
.djn-group-root>fieldset>.js-inline-admin-formset,
.djn-group-root>fieldset>details>.js-inline-admin-formset {
  padding: 0 !important;
  border: none !important;
}


fieldset.module.djn-module .flex-container {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start;
  gap: 0.25rem 1rem;
  width: 100%;
}

fieldset.module.djn-module .flex-container>label {
  flex: 0 0 200px !important;
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
  padding-top: 0.375rem;
  font-weight: normal;
  word-break: break-word;
  text-align: left;
}

fieldset.module.djn-module .flex-container>input:not([type="hidden"]),
fieldset.module.djn-module .flex-container>select,
fieldset.module.djn-module .flex-container>textarea,
fieldset.module.djn-module .flex-container>div,
fieldset.module.djn-module .flex-container>p,
fieldset.module.djn-module .flex-container>span.select2-container {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

fieldset.module.djn-module .flex-container.checkbox-row {
  flex-direction: row-reverse !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

fieldset.module.djn-module .flex-container.checkbox-row>label {
  margin-bottom: 0 !important;
  padding-top: 0 !important;
}

fieldset.module.djn-module .flex-container.checkbox-row>input[type="checkbox"] {
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
}

fieldset.module.djn-module .form-row {
  padding: 0.4rem 0.75rem;
  border-bottom: none !important;
  overflow: visible;
}

fieldset.module.djn-module {
  padding: 0.25rem 0.5rem !important;
  border: none;
  background: transparent;
}

@media (max-width: 576px) {
  fieldset.module.djn-module .form-row>div {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  fieldset.module.djn-module .flex-container {
    flex-direction: column !important;
    gap: 0.25rem;
    align-items: stretch !important;
  }

  fieldset.module.djn-module .flex-container>label {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-top: 0;
  }

  fieldset.module.djn-module .flex-container>input:not([type="hidden"]),
  fieldset.module.djn-module .flex-container>select,
  fieldset.module.djn-module .flex-container>textarea,
  fieldset.module.djn-module .flex-container>div,
  fieldset.module.djn-module .flex-container>p,
  fieldset.module.djn-module .flex-container>span.select2-container {
    width: 100% !important;
    flex: 1 1 auto !important;
  }

  fieldset.module.djn-module .flex-container.checkbox-row {
    flex-direction: column-reverse !important;
    align-items: flex-start !important;
  }
}

@media (max-width: 575px) {
  .content-wrapper .p-5 {
    padding: 0.5rem !important;
  }

  .inline-group>.inline-related,
  .inline-group .js-inline-admin-formset .items .inline-related {
    padding: 0 !important;
  }

  .djn-inline-form .card-header .card-title {
    overflow: hidden;
    flex: 1 1 0;
    min-width: 0;
  }

  .djn-inline-form .card-header .card-title .card-tools {
    font-size: 0.82rem !important;
    word-break: break-word;
    overflow-wrap: break-word;
    display: block;
  }

  .djn-inline-form .card-header .delete,
  .djn-inline-form .card-header>span:last-child:not(.card-title) {
    flex-shrink: 0;
    margin-left: 0.5rem;
  }

  .flex-container .related-widget-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .flex-container .select2-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .flex-container .select2-selection--single {
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .flex-container .select2-selection__rendered {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: block !important;
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .select2-dropdown {
    max-width: calc(100vw - 1rem) !important;
    box-sizing: border-box !important;
  }

  fieldset.module.djn-module .flex-container>div {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
  }

  .content-wrapper .col-sm-7 {
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
  }

  .content-wrapper input[type="text"],
  .content-wrapper input[type="number"],
  .content-wrapper input[type="email"],
  .content-wrapper textarea {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .content-wrapper .js-inline-admin-formset {
    padding: 0.5rem !important;
  }

  .djn-inline-form {
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .djn-inline-form .col-md-4,
  .djn-inline-form .col-md-7 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .content-wrapper .djn-group-nested,
  .content-wrapper .djn-items,
  .content-wrapper .djn-group,
  .content-wrapper .inline-group {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .content-wrapper .djn-tabular table {
    width: auto !important;
    min-width: 100%;
  }

  .content-wrapper .djn-tabular {
    overflow-x: auto !important;
    max-width: 100% !important;
  }

  .content-wrapper fieldset.module.djn-module {
    max-width: 100% !important;
    overflow: hidden;
    box-sizing: border-box;
  }
}

/* Sidebar: permitir que los nombres largos se muestren completos */
.nav-sidebar .nav-link,
.nav-sidebar .nav-link p {
  white-space: normal !important;
  text-overflow: clip !important;
  overflow: visible !important;
  line-height: 1.3;
}

/* Estilos para mensajes de error de validación en formularios e inlines */
.field-wrapper .errorlist {
  color: #dc3545 !important;
  font-style: italic !important;
  list-style-type: disc !important;
  padding-left: 1.2rem !important;
  margin-top: 0.25rem !important;
  margin-bottom: 0 !important;
  font-size: 0.8rem !important;
}

.field-wrapper .errorlist li {
  color: #dc3545 !important;
  font-style: italic !important;
}

/* Alinea el mensaje de error exactamente bajo el input (respetando los 200px de la etiqueta y el gap de 1rem) */
.field-wrapper:not(.checkbox-wrapper) .errorlist {
  margin-left: calc(200px + 1rem) !important;
}

@media (max-width: 576px) {
  .field-wrapper:not(.checkbox-wrapper) .errorlist {
    margin-left: 0 !important;
  }
}