/* overrides to default admin and bootstrap styles */
:root {
  --primary: #428bca;
  --info: #5bc0de;
  --success: #28a745;
  --danger: #ff3547;
  --gray: #777777;
  --gray-lighter: #eeeeee;
  --box-shadow: 5px 5px 13px #626262;
  --sm-box-shadow: 0 6px 12px rgba(0,0,0,.175);
  --sm-inset-box-shadow: inset 1px 0px 5px 0px #010101;
}

/* Sidebar Styles */
.side-menu {
  z-index: 1;
  position: fixed;
  left: 180px;
  width: 50px;
  height: 100%;
  margin-left: -180px;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-transition: width 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: width 0.2s ease;
}
.side-menu::-webkit-scrollbar {
  display: none;
}
.side-menu ul {
  list-style: none;
  padding: 0;
  margin-top: 0;
}
.side-menu i {
  left: 10px;
  position: relative;
}
.side-menu a {
  display: block;
  text-decoration: none;
  white-space: nowrap;
}
.side-menu a.dropdown-toggle {
  text-decoration: none;
  color: white;
  font-family: Helvetica, sans-serif;
  letter-spacing: 0.3px;
  font-weight: lighter;
}
.side-menu li {
  line-height: 35px;
}
.side-menu__empty_icon {
  height: 20px;
  width: 20px;
  display: inline-block;
  vertical-align: middle;
  border: solid thin gray;
  border-radius: 10px;
}
.side-menu__content {
  position: absolute;
  top: 0;
  width: 100%;
  margin: 0;
  padding: 0 0 40px;
}
.side-menu__content .select2-container {
  width: 100% !important;
}
.side-menu__item:hover {
  background-color: #e9e9e9;
}
.side-menu__submenu {
  background-color: white;
  box-shadow: inset 8px 6px 20px 0px rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: inset 8px 6px 20px 0px rgba(0, 0, 0, 0.2);
}
.side-menu__apptext {
  margin-left: 30px;
}
.side-menu__active {
  font-weight: bold !important;
}
.side-menu__model {
  padding-left: 5px;
  padding-top: 4px;
  padding-bottom: 4px;
  color: #525252 !important;
  border-right: solid thin #CCCCCC;
}
.side-menu__search {
  width: 100%;
  background: white !important;
  color: white !important;
}
.side-menu__add_logo {
  position: absolute;
  top: 100px;
  right: 5px;
  cursor: pointer;
  color: var(--info);
}
.side-menu .select2-selection {
  background-color: white;
}
.side-menu input:-ms-input-placeholder {
  color: white;
}
.side-menu input::-webkit-input-placeholder {
  color: white;
}
.side-menu input::-webkit-input-placeholder {
  color: white;
}
.side-menu__add {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  font-size: 1.5rem;
}
.side-menu__add:hover {
  opacity: 1;
}
.side-menu__model:hover ~ .side-menu__add {
  opacity: 1;
}

#select2-side-menu__search-results a {
  display: inline-block;
  width: 100%;
  color: inherit;
}
#select2-side-menu__search-results a:hover {
  text-decoration: none;
}

#select2-side-menu__search-container a {
  color: inherit;
}

#select2-side-menu__search-container .select2-selection__placeholder {
  margin-left: 5px;
  margin-right: 5px;
}

/*!
 * Start Bootstrap - Simple Sidebar HTML Template (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */
#wrapper {
  padding-left: 50px;
  -webkit-transition: width 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: width 0.2s ease;
}
#wrapper.toggled {
  padding-left: 180px;
}
#wrapper.toggled .side-menu {
  width: 180px;
  margin-right: 20px;
  box-shadow: 1px 1px 10px 4px rgba(0, 0, 0, 0.2);
}

.sofisis-top-navbar {
  height: 50px;
}
.sofisis-top-navbar .navbar-toggle {
  display: block;
}
.sofisis-top-navbar > div {
  float: left;
  list-style: none;
  margin-left: 5px;
  margin-right: 5px;
}
.sofisis-top-navbar .name-user-session {
  float: left;
  margin-top: 15px;
}
.sofisis-top-navbar .dropdown-user {
  float: right;
}

.icon_img {
  width: 30px;
  height: 30px;
  margin-top: 2px;
}

form.navbar-left {
  margin-top: 0 !important;
}

.navbar-nav.navbar-right:last-child {
  margin-right: 0;
}

.expiration-message {
  margin-top: 10px;
  margin-right: 6px;
}
.expiration-message a {
  color: #cb0050;
}

#form_get_company {
  margin-top: 10px;
}
#form_get_company select {
  width: max-content;
  display: inline-block;
}
#form_get_company .related-widget-wrapper {
  display: inline-block;
}

@media (max-width: 480px) {
  #form_get_company select {
    width: 120px;
    min-width: 120px;
  }
  #form_get_company .related-widget-wrapper-link {
    display: none;
  }

  .sofisis-top-navbar > div {
    margin-left: 1px;
    margin-right: 1px;
  }
}

label[for="id_company_selector"] {
  font-weight: bold;
  margin-right: 5px;
  font-size: 1.3rem;
}

body {
  padding-bottom: 40px;
  overflow-y: scroll;
}

a {
  cursor: pointer;
}
a:active, a:focus {
  outline: none;
}

@media only screen {
  #container-div {
    margin-bottom: 500px;
  }
}
legend {
  font-size: 14px;
  font-weight: bold;
}
legend a:hover {
  text-decoration: none;
}

.badge a {
  color: #fff;
}
.badge a:hover {
  color: #fff;
}

.form-icon {
  height: 20px;
  width: 20px;
  margin: -10px 0;
}

.description {
  color: #9a9a9a;
  font-size: 12px;
  display: inline-block;
  margin: 0;
}

.disabled {
  cursor: not-allowed !important;
  box-shadow: none;
  pointer-events: none;
}
.disabled:hover {
  box-shadow: none;
}

.accordion-control .related-widget-wrapper {
  min-width: 300px;
}

select + .related-widget-wrapper-link, .related-widget-wrapper-link + .related-widget-wrapper-link {
  margin: 0 !important;
}

.admin-image {
  max-height: 100px;
  max-width: 100px;
}

.inline-block {
  display: inline-block;
}

.tooltip.in {
  opacity: 1;
}

/* Hard to see against black text otherwise */
.scrollable-dropdown-menu {
  overflow-x: hidden;
  max-height: 322px;
}

.scrollable-dropdown-menu li form a {
  clear: both;
  color: #333;
  display: block;
  font-weight: normal;
  line-height: 1.42857;
  padding: 3px 20px;
  white-space: nowrap;
}

.container {
  width: 95%;
  padding: 0 10px 20px 10px;
}

.navbar-header {
  margin: 0;
  float: none;
}
.navbar-header .pull-left #form_search_client #id_user {
  width: 20em;
}

.input-w-full input[type=text], .input-w-full input[type=number],
.input-w-full input[type=checkbox], .input-w-full select,
.input-w-full .related-widget-wrapper select {
  width: 100% !important;
}

.gsc-adBlock, .gcsc-branding {
  display: none !important;
}

.help-block, .helptext {
  margin: 0 5px;
}

.glyphicon-question-sign {
  display: inline;
}

.text-danger {
  display: block;
  color: #a94442;
}

#logo1 {
  height: 100px;
  background: white no-repeat center;
}

.total-background {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  /* Preserve aspet ratio */
  min-width: 100% !important;
  min-height: 100% !important;
  z-index: -1 !important;
}

#pie-print {
  display: none;
}

.p-0 {
  padding: 0;
}

.errorlist, .errornote {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
  padding: 15px;
  border-radius: 4px;
}

.glyphicon-refresh-animate {
  -animation: spin 0.7s infinite linear;
  -webkit-animation: spin2 0.7s infinite linear;
}

@-webkit-keyframes spin2 {
  from {
    -webkit-transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(360deg);
  }
}
@keyframes spin {
  from {
    transform: scale(1) rotate(0deg);
  }
  to {
    transform: scale(1) rotate(360deg);
  }
}
div.error {
  border: none !important;
}

body.popup #wrapper {
  padding-left: 0;
}

.logo {
  max-height: 100px;
  max-width: 200px;
}

.img_logo {
  height: 70px;
}

.inline.collapse.in {
  display: inline;
}

.obj-tools {
  list-style-type: none;
  padding: 0;
}
.obj-tools > div {
  display: inline;
}
.obj-tools > li {
  display: inline;
}
.obj-tools > li.dropdown {
  position: initial;
}
.obj-tools > li.dropdown ul.dropdown-menu.pull-right {
  right: 28.625px;
  top: 125px;
}

.btn-outline-primary {
  border: solid thin !important;
  color: var(--info) !important;
}

.obj-title{
            top: 0!important;
            background-color: #efefef!important;
            z-index: 1!important;
            border-radius: 5px!important;
            padding: 0.1px 0 0px 10px!important;
            -webkit-box-shadow: -9px 10px 20px 0px rgba(0,0,0,0.18)!important;
            -moz-box-shadow: -9px 10px 20px 0px rgba(0,0,0,0.18)!important;
            box-shadow: -9px 10px 20px 0px rgba(0,0,0,0.18)!important;
            border-bottom: solid 0.5px var(--primary) !important;
        }
        .select2-dropdown{
            z-index: 5!important;
        }

.obj-title h2 {
  margin-top: 10px;
  margin-bottom: 6px;
}

.modal-body {
  min-height: 300px;
}

.content_link_export {
  text-align: right;
}
.content_link_export a {
  font-size: 24px;
}

.circular {
  width: 100px;
  height: 100px;
  border-radius: 75px;
  -webkit-border-radius: 75px;
  -moz-border-radius: 75px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.circular_photo_user {
  width: 44px;
  height: 44px;
  margin: 2px 3px 0 3px;
}

#circular_photo_user {
  font-size: 20px;
  text-align: center;
  font-weight: bold;
  vertical-align: middle;
  background-color: var(--primary);
  color: white;
  line-height: 50px;
}

.shadow {
  -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.dropdown-user a {
  text-decoration: none;
}

.dropdown-menu-photo-user {
  top: 45px;
}

.my-modal-content ul {
  padding-left: 5px;
}

.columns-to-show label {
  padding-left: 5px;
  padding-right: 5px;
  cursor: pointer;
}

h5 {
  font-weight: bold;
}

body.dragging, body.dragging * {
  cursor: move !important;
}

.dragged {
  position: absolute;
  opacity: 0.5;
  z-index: 2000;
}

ol.example li.placeholder {
  position: relative;
}

ol.example li.placeholder:before {
  position: absolute;
}

.delete-history-tab {
  margin-left: 10px;
  margin-bottom: 0;
  margin-top: 0;
}

div.well.sort-item > div.form-group {
  width: 45%;
}

#livechat-compact-container {
  height: 300px;
  position: fixed;
  right: 0;
  top: 80vh;
  z-index: 10000;
  text-align: center;
}

.btn-chat a {
  font-family: arial;
  color: #fff;
  text-decoration: none;
  background: #128c7e;
  padding: 20px 20px 20px;
  display: block;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 0 0 1px #128c7e inset;
  border-radius: 15px;
  -ms-transform: rotate(90deg) translate(0, -20px);
  -webkit-transform: rotate(90deg) translate(0, -20px);
  transform: rotate(0deg) translate(0, -20px);
  position: relative;
  right: 27px;
  transition: background 0.2s, right 0.2s;
  text-align: center;
}

.btn-chat a:hover {
  background: #075e54;
  right: 27px;
  transition: background 0.2s, right 0.2s;
  border-radius: 15px;
}

select {
  -moz-appearance: none;
}

.btn {
  padding: 10px 10px;
  height: auto;
  box-shadow: var(--sm-box-shadow);
}
.btn:active {
  box-shadow: var(--sm-inset-box-shadow);
}

.related-widget-wrapper-link img {
  height: 20px;
}

.tabular .money_field, .tabular .percentage_field, .tabular .float-field, .tabular .element-qnt-field {
  text-align: right;
}

.text-to-div {
  display: inline;
}
.text-to-div p {
  margin: 0;
}

.alert-error {
  background-color: #f2dede;
  border-color: #ebccd1;
  color: #be0000;
}

.screen_only {
  display: none;
}

.breadcrumb {
  margin: 0 4px 0 4px;
  padding: 0;
  background-color: #ffffff;
  font-size: 11px;
  opacity: 0.7;
}

.menu-state-finance a {
  display: block;
}

.nav-ico-menu {
  padding-top: 10px;
}

.tooltip-inner {
  white-space: pre-wrap;
  max-width: none;
  width: auto;
  text-align: left;
}

.top-tools {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.top-tools .btn,
.dj-search__input {
  margin-right: 0;
  margin-bottom: 6px;
}
.top-tools .action-search {
  margin: 10px 0;
}
.top-tools select[name=action] {
  width: 100px;
}

.ui-tooltip {
  background-color: black;
  color: white;
  padding: 3px;
  border-radius: 3px;
  width: 400px;
  height: auto;
  z-index: 2000;
}

.side-menu li a span.side-menu__apptext,
.side-menu__search,
#logo1,
.side-menu__logo,
.side-menu__item {
  display: none;
}

#wrapper.toggled .side-menu li a span.side-menu__apptext {
  display: inline-block;
}
#wrapper.toggled .side-menu__item {
  display: inherit;
  position: relative;
  line-height: 1;
}
#wrapper.toggled.toggled .side-menu__search,
#wrapper.toggled.toggled #logo1,
#wrapper.toggled.toggled #open-modal-menu,
#wrapper.toggled.toggled .side-menu__logo {
  display: inherit;
}
#wrapper .icon-nav {
  width: 14px;
  font-size: 20px;
  top: 5px;
}

select {
  padding-left: 8px;
}

.side-menu {
  background-color: var(--primary);
}
.side-menu__logo {
  padding: 10px;
  background-color: white;
}

.table-history__inline-item {
  margin: 10px 0;
}
.table-history__changed-value {
  margin: 0 0 10px 0;
}

/* tablets */
@media (min-width: 768px) and (max-width: 1200px) {
  .accordion_movil {
    display: none;
  }

  .my-hidden-xs {
    display: block;
  }

  .side-menu {
    width: 50px;
  }

  #wrapper.toggled .side-menu li.dropdown a span.side-menu__apptext {
    display: initial;
  }

  #wrapper.toggled .side-menu__search,
#wrapper.toggled #logo1,
#wrapper.toggled #open-modal-menu,
#wrapper.toggled .side-menu__logo,
#wrapper.toggled .side-menu__item {
    display: block;
  }
}
/* super screens */
@media (min-width: 2000px) {
  .sofisis-top-navbar .container {
    width: 100%;
  }

  .container {
    width: 80%;
  }
}
/* phone */
@media (max-width: 480px) {
  #wrapper {
    padding-left: 0;
  }

  .title-change {
    margin: 0;
  }

  .container {
    width: 100%;
  }

  .mceLayout, #id_content_toolbargroup {
    width: 550px !important;
  }

  .side-menu {
    width: 0;
  }

  .breadcrumb, .no-display-mobil {
    display: none !important;
  }

  #jsign_sign div input {
    left: 245px !important;
  }

  #jsign_sign div input {
    left: 245px !important;
  }

  .fieldset_totalized_fields {
    width: 100%;
  }

  .form-row {
    padding: 0;
  }

  #changelist-form {
    padding-left: 5px;
  }

  .mceLayout, #id_content_toolbargroup {
    width: 300px !important;
  }

  #id_content_formatselect_text, #id_content_fontsizeselect_text, #id_content_fontselect_text {
    width: 10px !important;
  }

  #id_content_help {
    display: none;
  }
}
/* phone and tablet */
@media (max-width: 768px) {

  /* ===== TIPOGRAFÍA MOBILE (16px base — estándar iOS/Material Design) ===== */
  body { font-size: 16px; }

  /* 16px en inputs evita el auto-zoom de iOS Safari */
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="date"],
  input[type="time"],
  select,
  textarea,
  .form-control { font-size: 16px !important; }

  /* Select2 — todos los elementos */
  .select2-container,
  .select2-selection,
  .select2-selection__rendered,
  .select2-selection__placeholder,
  .select2-search__field,
  .select2-results__option { font-size: 16px !important; }

  /* Botones */
  .btn { font-size: 16px; }

  /* Navegación */
  .navbar,
  .dropdown-menu > li > a { font-size: 16px; }

  /* Tablas: 14px es suficiente para datos densos */
  .table td,
  .table th { font-size: 14px; }

  /* Texto secundario */
  .description,
  .help-block,
  .helptext,
  .breadcrumb { font-size: 13px; }
  /* ===== FIN TIPOGRAFÍA MOBILE ===== */

  .action-search {
    float: left;
  }

  #wrapper.toggled .side-menu {
    width: 100vw;
    z-index: 1055;
    font-size: 16px;
  }

  /* App items — altura 56px, texto 17px */
  #wrapper.toggled .side-menu li {
    line-height: 56px;
  }

  #wrapper.toggled .side-menu a.dropdown-toggle {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.2px;
  }

  /* Model items — altura 52px con flexbox */
  #wrapper.toggled .side-menu .side-menu__model {
    font-size: 16px;
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    line-height: 1.3;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }

  /* Iconos 28px — claramente más grandes */
  #wrapper.toggled .side-menu .icon-nav {
    width: 28px !important;
    height: 28px !important;
    font-size: 28px !important;
    flex-shrink: 0;
    vertical-align: middle;
  }

  #wrapper.toggled .side-menu img.icon-nav {
    width: 28px !important;
    height: 28px !important;
    margin-right: 14px !important;
    margin-left: 12px !important;
  }

  /* Model items use bare <img> with no class — must target directly */
  #wrapper.toggled .side-menu .side-menu__item img {
    width: 28px !important;
    height: 28px !important;
    margin-right: 12px !important;
    flex-shrink: 0;
    vertical-align: middle;
  }

  /* Placeholder icono (círculo vacío) */
  #wrapper.toggled .side-menu .side-menu__empty_icon {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
    border-radius: 14px !important;
  }

  #wrapper.toggled {
    padding-left: 0;
  }

  #wrapper .side-menu__add {
    display: none;
  }

  a.side-menu__model {
    padding-left: 5px;
  }

  .icon_img {
    width: 20px;
    height: 20px;
    margin-top: 2px;
  }

  #content-aceptar {
    text-align: center;
  }

  #aceptar {
    position: absolute;
    padding: 10px 0;
    left: auto;
    top: 0;
  }

  .table-history {
    margin-top: 20px;
  }

  .my-modal-content {
    width: 80%;
    min-width: 280px;
    margin: 50px auto;
    position: relative;
  }

  .my-modal {
    background-color: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 1;
    z-index: 1050;
    overflow: scroll;
  }

  .initial_modal {
    display: none;
  }

  a#button-close {
    position: absolute;
    left: auto;
    right: 25px;
  }

  #content {
    margin-left: 5px;
    margin-right: 5px;
  }

  .search_list {
    display: none;
  }

  .change-related-mobile {
    display: block;
    position: absolute !important;
    top: 10px !important;
    right: auto;
    bottom: 0;
    left: 140px !important;
    z-index: 10200;
    font-size: 20px;
    width: 20px;
    height: 20px;
    pointer-events: all;
  }

  .add-related-mobil {
    display: block;
    position: absolute !important;
    top: 10px !important;
    right: auto;
    bottom: 0;
    left: 180px !important;
    z-index: 10200;
    font-size: 20px;
    width: 20px;
    height: 20px;
    pointer-events: all;
  }
}
@media (max-width: 480px) {
  #wrapper.toggled .side-menu {
    width: 100vw;
  }

  #wrapper.toggled {
    padding-left: 0;
  }
}
.help-tooltip {
  display: inline;
}

.rounded-thumbnail {
  object-fit: cover;
  object-position: center;
  width: 50px;
  height: 50px;
  border-radius: 25px;
}

.text-right {
  text-align: right;
}

@media (min-width: 992px) {
  .table-responsive {
    overflow-x: initial;
  }
}
@media screen {
  .hidden-screen {
    display: none;
  }
}

/* Scroll horizontal para tablas grandes en informes */
.report-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Adjust the width of the container to control the scrollable area */
.table-container {
  width: 100%;
  height: fit-content;
  overflow-x: scroll;
}

/* Style the table to ensure proper layout within the container */
.table-container table {
  width: 100%;
  white-space: nowrap; /* Prevent table content from wrapping */
}

/* ===== MOBILE BOTTOM NAVIGATION ===== */
#mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
    z-index: 1068;
    /* translate3d fuerza capa GPU dedicada — evita que Chrome/Safari lo posicione
       relativo al scroll container en páginas muy largas */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

/* Ocultar en escritorio — no afecta desktop */
@media (min-width: 769px) {
    #mobile-bottom-nav {
        display: none !important;
    }
}

#mobile-bottom-nav .mobile-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
    font-size: 10px;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

#mobile-bottom-nav .mobile-bottom-nav__item i {
    font-size: 22px;
    margin-bottom: 3px;
}

#mobile-bottom-nav .mobile-bottom-nav__item:active,
#mobile-bottom-nav .mobile-bottom-nav__item--active {
    color: var(--primary);
}

/* Swap bars → arrow cuando el sidebar está abierto */
.mobile-nav-arrow { display: none; }
.mobile-nav-bars  { display: inline-block; }

#wrapper.toggled ~ #mobile-bottom-nav .mobile-nav-arrow { display: inline-block; }
#wrapper.toggled ~ #mobile-bottom-nav .mobile-nav-bars  { display: none; }

@media (max-width: 768px) {
    /* overflow-x:hidden en html/body se propaga al viewport y bloquea TODOS los
       gestos táctiles horizontales, incluso en hijos con overflow-x:auto.
       Solución: moverlo a #wrapper (no-raíz). Un BFC en un elemento no-raíz
       recorta sin afectar el reconocedor de gestos del viewport. */
    html {
        max-width: 100vw;
    }
    body {
        padding-bottom: 56px !important;
        max-width: 100vw;
        /* Quitar overflow-y:scroll en móvil — en Chrome mobile el body con scroll
           se convierte en scroll container y position:fixed queda relativo a la
           altura total de la página en vez del viewport */
        overflow-y: auto !important;
    }
    #wrapper {
        overflow-x: hidden;
        max-width: 100%;
    }

    /* Inlines y tablas: scroll horizontal interno en vez de romper el layout */
    .inline-group,
    .inline-related {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .inline-group table,
    .inline-related table {
        min-width: max-content;
    }

    /* Sidebar flota encima del contenido pero por debajo de modales y bottom nav */
    .side-menu {
        z-index: 1055;
        height: calc(100% - 56px);
    }

    /* Ocultar navbar superior — reemplazado por el panel de perfil en móvil */
    .sofisis-top-navbar {
        display: none !important;
    }

    body.mobile-panel-open {
        overflow: hidden !important;
    }
}

/* ===== PANEL PERFIL MÓVIL ===== */

#mobile-profile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    bottom: 56px;
    background: rgba(0,0,0,0.45);
    z-index: 1057;
}
#mobile-profile-overlay.active { display: block; }

#mobile-profile-panel {
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
    z-index: 1058;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* translate3d fuerza capa GPU — evita el bug de iOS Safari en páginas largas */
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
    padding: 0 20px 28px;
}
#mobile-profile-panel::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto 16px;
}
#mobile-profile-panel.active {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

#mobile-profile-panel__title {
    display: flex;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}
#mobile-profile-panel__title .fa-user-circle {
    font-size: 22px;
    color: var(--primary);
    margin-right: 8px;
}
#mobile-profile-panel__title span {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    flex: 1;
}
#mobile-profile-panel__close {
    background: none;
    border: none;
    font-size: 20px;
    color: #888;
    padding: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

#mobile-profile-panel__header {
    display: flex;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}
#mobile-profile-panel__header .mobile-profile-icon {
    font-size: 38px;
    color: var(--primary);
    flex-shrink: 0;
    margin-right: 12px;
    line-height: 1;
}
#mobile-profile-panel__header .mobile-profile-name {
    flex: 1;
    min-width: 0;
}
#mobile-profile-panel__header .mobile-profile-name .name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#mobile-profile-panel__header .mobile-profile-name .email {
    font-size: 13px;
    color: #777;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mobile-profile-panel__company {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
#mobile-profile-panel__company label[for="id_company_selector"] {
    font-size: 13px;
    color: #777;
    font-weight: normal;
    margin-bottom: 6px;
    display: block;
}
#mobile-profile-panel__company .select2-container { width: 100% !important; }
#mobile-profile-panel__company form { float: none !important; }
#mobile-profile-panel__company .related-widget-wrapper-link { display: none; }

#mobile-profile-panel__menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
#mobile-profile-panel__menu li a {
    display: flex;
    align-items: center;
    padding: 14px 4px;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
}
#mobile-profile-panel__menu li a i {
    width: 28px;
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
    text-align: center;
    margin-right: 10px;
}
#mobile-profile-panel__menu li:last-child a { border-bottom: none; }
.mobile-profile-panel__language {
    display: flex;
    align-items: center;
    padding: 14px 4px;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.mobile-profile-panel__language > .fa {
    width: 28px;
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
    text-align: center;
    margin-right: 10px;
}

#mobile-bottom-nav .mobile-bottom-nav__item.profile-active {
    color: var(--primary);
}

@media (min-width: 769px) {
    #mobile-profile-panel,
    #mobile-profile-overlay {
        display: none !important;
    }
}

@media print {
    #mobile-profile-panel,
    #mobile-profile-overlay,
    #mobile-bottom-nav {
        display: none !important;
    }
}

/* ===== MOBILE OPCIONES DROPDOWN ===== */

/* Oculto en desktop, visible solo en móvil */
.mobile-opciones-dropdown {
    display: none !important;
}
@media (max-width: 767px) {
    .mobile-opciones-dropdown {
        display: inline-block !important;
    }
    /* Backdrop: cubre el contenido detrás del panel */
    .mobile-opciones-dropdown.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 56px;
        background: rgba(0,0,0,0.45);
        z-index: 1058;
    }
    /* Panel: ocupa toda la altura disponible sobre el bottom-nav */
    .mobile-opciones-dropdown .mobile-opciones-menu {
        position: fixed !important;
        top: 0 !important;
        bottom: 56px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: #fff !important;
        z-index: 1059 !important;
        padding: 0 0 16px !important;
    }
    .d-inline-obj-tools {
        display: none !important;
    }
    .obj-tools .actions {
        display: none !important;
    }
}

/* Estilos del menú (position:absolute — fuera de media query) */
.mobile-opciones-menu {
    min-width: 220px;
    white-space: normal !important;
    overflow-x: hidden !important;
}
.mobile-opciones-menu .mobile-opciones-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.mobile-opciones-menu .mobile-opciones-header span {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}
.mobile-opciones-close {
    background: none;
    border: none;
    padding: 8px;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.mobile-opciones-menu > li {
    display: block !important;
}
.mobile-opciones-menu .mobile-opciones-subheader {
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}
.mobile-opciones-menu > li > a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    float: none !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    color: #333 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-align: left !important;
    width: 100% !important;
    margin: 0 !important;
    min-height: 48px;
    border-bottom: 1px solid #f0f0f0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}
/* Ícono: tamaño fijo, sin márgenes propios — el gap del flex maneja el espacio */
.mobile-opciones-menu > li > a .glyphicon,
.mobile-opciones-menu > li > a .fa,
.mobile-opciones-menu > li > a img {
    width: 20px;
    font-size: 18px;
    flex-shrink: 0;
    text-align: center;
    color: var(--primary);
    margin: 0 !important;
}
/* Texto: ocupa el espacio restante y quiebra correctamente */
.mobile-opciones-menu > li > a span:not(.glyphicon):not(.fa) {
    flex: 1;
    min-width: 0;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}
.mobile-opciones-menu > li > a:hover,
.mobile-opciones-menu > li > a:focus {
    background-color: #f5f5f5 !important;
    color: #333 !important;
    text-decoration: none;
}

/* Ocultar .columns-to-show en móvil sin sacarlo del DOM */
@media (max-width: 767px) {
    .columns-to-show {
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }

    .obj-title {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .obj-title h2 {
        margin-top: 4px !important;
        margin-bottom: 10px !important;
    }

    #patient-fixed-info-mobile {
        background-color: var(--primary);
        border-radius: 8px;
        padding: 10px 12px;
        margin-bottom: 8px;
        color: #fff;
    }

    #patient-fixed-info-mobile label {
        display: none !important;
    }

    #patient-fixed-info-mobile #fixed-years-old-mobile,
    #patient-fixed-info-mobile #fixed-sex-mobile {
        color: #fff;
        font-size: 13px;
        opacity: 0.9;
    }

    #patient-fixed-info-mobile > div > div:last-child {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    #patient-fixed-info-mobile .related-widget-wrapper {
        display: flex !important;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    #patient-fixed-info-mobile .select2-container {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        width: 0 !important;
        max-width: 100% !important;
    }

    #patient-fixed-info-mobile .select2-selection {
        background: transparent !important;
        border-color: rgba(255, 255, 255, 0.4) !important;
    }

    #patient-fixed-info-mobile .select2-selection__rendered {
        color: #fff !important;
    }

    #patient-fixed-info-mobile .select2-selection__placeholder {
        color: rgba(255, 255, 255, 0.7) !important;
    }

    #patient-fixed-info-mobile .related-widget-wrapper-link {
        flex-shrink: 0;
    }

    /* Layout responsive: botones y buscador apilados */
    .top-tools {
        flex-direction: column;
        gap: 1px;
    }

    .obj-tools {
        display: flex !important;
        width: 100%;
        align-items: center;
        margin: 0;
        gap: 8px;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .obj-tools > li {
        flex: 1;
    }

    .obj-tools > li > a.btn {
        width: 100%;
        margin-right: 0;
        box-sizing: border-box;
    }

    .action-search {
        display: flex !important;
        align-items: center;
        width: 100% !important;
        min-width: 0;
        overflow: hidden;
        margin-left: 0 !important;
        gap: 0;
        float: none !important;
        flex-wrap: nowrap;
    }

    .action-search form.dj-search {
        flex: 1 1 0;
        min-width: 0;
        margin-right: 8px;
    }

    .action-search form.dj-search > div {
        width: 100%;
        min-width: 0;
    }

    .action-search form.dj-filter {
        flex-shrink: 0;
        margin-left: 0 !important;
    }

    .action-search > div {
        flex-shrink: 0;
        margin-left: 0;
    }

    /* Sin buscador: filtro ocupa todo el ancho disponible */
    .action-search:not(:has(form.dj-search)) form.dj-filter {
        flex: 1;
    }

    .action-search:not(:has(form.dj-search)) form.dj-filter > div,
    .action-search:not(:has(form.dj-search)) form.dj-filter .open-filter {
        width: 100%;
    }

    .action-search .btn {
        padding-top: 7px !important;
        padding-bottom: 7px !important;
        box-shadow: none !important;
    }

    .action-search .dj-search__input {
        box-shadow: none !important;
    }

    .obj-tools > li > a.btn {
        box-shadow: none !important;
    }
}

/*# sourceMappingURL=base.css.map */
