.btn{
    box-shadow:none !important;
}
.btn:hover{
    background-color: #348396 !important;
    box-shadow: none !important;
    border-color: #348396 !important;
}
.btn-primary{
    background-color: #348396 !important;
    border-color: #348396 !important;
    box-shadow: none !important;
}
.btn-primary:hover{
    background-color: #348396 !important;
    box-shadow: none !important;
    border-color: #348396 !important;
}
.bg-primary{
    background-color: #348396 !important;
}
.btn-warning:hover{
  background-color: orange !important;
  border-color: orange !important;
}
.auth-fluid{background:none!important}

.navbar-custom .nav-user,
body[data-layout-color=dark] .navbar-custom .nav-user{
    background-color:transparent!important;
    border:none!important;
}

.account-user-avatar:hover{
  color: #348396 !important;
}

.account-user-avatar small{
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Topbar: menú hamburguesa con icono centrado; quitar float del tema en el botón */
.navbar-custom .button-menu-mobile {
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  padding: 0;
  flex-shrink: 0;
}
.navbar-custom .button-menu-mobile .bi {
  line-height: 1;
  display: block;
}

.navbar-custom .topbar-menu{
  display:flex;
  align-items:center;
  height:70px;
  max-height:70px;
  overflow:hidden;
}
.navbar-custom .topbar-menu > li{
  float:none;
  display:flex;
  align-items:center;
  height:70px;
  max-height:70px;
  overflow:hidden;
}
.topbar-icon-link{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  width:2.5rem;
  height:2.5rem;
  max-height:2.5rem;
  padding:0 !important;
  line-height:1;
  transition:color .15s ease-in-out, background-color .15s ease-in-out;
}
.navbar-custom .topbar-menu .topbar-icon-link{
  margin:0 .75rem 0 4px !important;
}
.topbar-icon-link:hover,
.topbar-icon-link:focus{
  background-color:#c2e3e8 !important;
  color:#000 !important;
}
.topbar-icon-link:hover .bi,
.topbar-icon-link:focus .bi,
.topbar-icon-link:hover .noti-icon,
.topbar-icon-link:focus .noti-icon{
  color:#000 !important;
}
.navbar-custom .topbar-menu .topbar-user-link{
  display:inline-flex !important;
  align-items:center;
  gap:.5rem;
  width:auto;
  min-width:0;
  height:2.5rem;
  max-height:2.5rem;
  padding:0 .6rem !important;
  margin:0 .25rem 0 4px !important;
  line-height:1;
  transition:color .15s ease-in-out, background-color .15s ease-in-out;
}
.navbar-custom .topbar-menu .topbar-user-link .topbar-user-name{
  max-width:220px;
  font-weight:500;
}
.navbar-custom .topbar-menu .topbar-user-link:hover,
.navbar-custom .topbar-menu .topbar-user-link:focus{
  background-color:#c2e3e8 !important;
  color:#000 !important;
}
.topbar-badge{
  position:absolute;
  top:.15rem;
  right:.1rem;
  min-width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.65rem;
  line-height:1;
  padding:0 .35rem;
}
@media (max-width: 576px){
  .account-user-avatar small{display:none}
}
@media (min-width: 577px) and (max-width: 768px){
  .account-user-avatar small{max-width:140px}
}

/* Menú lateral: el bloque central debe poder encogerse (min-height: 0) para que aparezca scroll vertical */
.leftside-menu.d-flex.flex-column {
  min-height: 0;
}
.leftside-menu > .logo {
  flex-shrink: 0;
}
.leftside-menu .sidebar-scroll-region {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Transición al expandir/contraer la barra lateral (clase body.sidebar-narrow) */
.wrapper > .leftside-menu {
  transition:
    width 0.24s ease-out,
    min-width 0.24s ease-out,
    max-width 0.24s ease-out;
}
.wrapper > .content-page {
  transition: margin-left 0.24s ease-out;
}
.wrapper > .content-page > .content > .navbar-custom {
  transition: left 0.24s ease-out;
}
@keyframes leftside-narrow-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Modo estrecho (solo iconos), activado con clase body.sidebar-narrow vía botón del topbar */
body.sidebar-narrow .leftside-menu {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;
  overflow-x: visible;
  z-index: 1055;
}
body.sidebar-narrow .content-page {
  margin-left: 70px !important;
}
body.sidebar-narrow .navbar-custom {
  left: 70px !important;
}
body.sidebar-narrow .leftside-menu .logo {
  width: 70px;
  line-height: 1.2;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
body.sidebar-narrow .leftside-menu .logo .logo-lg img {
  height: 36px;
  margin-top: 7px;
  /*width: auto;
  max-width: 56px;*/
}
/* Ocultar textos del enlace principal; mantener flecha de submenú si existe */
body.sidebar-narrow .leftside-menu .side-nav-link > span:not(.menu-arrow) {
  display: none !important;
}
body.sidebar-narrow .leftside-menu .side-nav-link {
  position: relative;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
body.sidebar-narrow .leftside-menu .side-nav-link i {
  margin-right: 0 !important;
}
body.sidebar-narrow .leftside-menu .side-nav-link .menu-arrow {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
body.sidebar-narrow .leftside-menu .side-nav-item {
  position: relative;
}
/* Submenús: panel a la derecha de la barra estrecha */
body.sidebar-narrow .leftside-menu .side-nav-item > .collapse {
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 220px;
  margin: 0 !important;
  z-index: 1060;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
  background: var(--ct-bg-leftbar, #fff);
  border-radius: 0 0.35rem 0.35rem 0;
}
@media (max-width: 767.98px) {
  body.sidebar-narrow .leftside-menu {
    display: block !important;
    animation: leftside-narrow-in 0.22s ease-out;
  }
  /* En móvil el submenú se despliega hacia abajo (no panel flotante) */
  body.sidebar-narrow .leftside-menu .side-nav-item > .collapse {
    position: static;
    left: auto;
    top: auto;
    min-width: 0;
    margin: 0 !important;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
  }
  body.sidebar-narrow .leftside-menu .side-nav-second-level {
    padding-left: 0;
  }
  body.sidebar-narrow .leftside-menu .side-nav-second-level li a {
    display: block;
    padding: 0.45rem 0.25rem;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.1;
    white-space: normal;
    word-break: break-word;
  }
}

/* Sin transición en hover del menú lateral (override Coderthemes) */
.leftside-menu .side-nav .side-nav-link,
.leftside-menu .side-nav .menu-arrow,
.leftside-menu .side-nav-forth-level li .side-nav-link,
.leftside-menu .side-nav-forth-level li a,
.leftside-menu .side-nav-second-level li .side-nav-link,
.leftside-menu .side-nav-second-level li a,
.leftside-menu .side-nav-third-level li .side-nav-link,
.leftside-menu .side-nav-third-level li a {
  -webkit-transition: none !important;
  transition: none !important;
}

.leftside-menu .logo{
  line-height: 64px;
  width: 260px;
}

.leftside-menu .logo .logo-lg img{
  height: 60px;
  width: auto;
}
.page-item.active .page-link {
  background-color: #348396 !important;
  border-color: #348396 !important;
}

.leftside-menu .side-nav{
  padding-bottom: 5.75rem;
}
.leftside-menu-footer{
  z-index: 15;
  box-sizing: border-box;
  padding-inline-end: 10px;
}
/* Misma lista que el menú: hereda hover del tema; sin padding-bottom extra del scroll */
.leftside-menu .leftside-menu-footer .side-nav.side-nav-footer{
  padding-bottom: 0;
  width: 100%;
  box-sizing: border-box;
}
.leftside-menu .leftside-menu-footer .side-nav-footer > .side-nav-item,
.leftside-menu .leftside-menu-footer .side-nav-footer > .side-nav-item > form{
  width: 100%;
}
/* Mismo ancho percibido que Salones/Torres: el fondo hover usa todo el li (tema: margin 5px en dark) */
.leftside-menu .leftside-menu-footer .side-nav-footer .side-nav-link{
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.leftside-menu-footer button.side-nav-link{
  cursor: pointer;
}

/* Lista de notificaciones (tarjetas) */
.notificaciones-feed .notificacion-card {
  border-radius: 0.5rem;
}
.notificaciones-feed .notificacion-card--nueva {
  background: linear-gradient(90deg, rgba(52, 131, 150, 0.12) 0%, #fff 9%);
}
.notificaciones-feed .notificacion-card__icon {
  width: 3rem;
  height: 3rem;
  background: #f1f5f7;
  color: #5c6c7a;
}
.notificaciones-feed .notificacion-card__icon--nueva {
  background: rgba(52, 131, 150, 0.18);
  color: #348396;
}
.notificaciones-feed .notificacion-card__badges {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.notificaciones-feed .notificacion-badge-tipo {
  background: rgba(52, 131, 150, 0.12);
  color: #2a6b7a;
  border: 1px solid rgba(52, 131, 150, 0.28);
  font-weight: 600;
  font-size: 0.75rem;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.3;
  hyphens: auto;
}
@media (max-width: 575.98px) {
  .notificaciones-feed .notificacion-badge-tipo {
    font-size: 0.7rem;
  }
}
.notificaciones-feed .notificacion-card__cuerpo {
  max-height: 14rem;
  overflow-y: auto;
  line-height: 1.5;
  word-break: break-word;
}
.notificaciones-feed .btn-primary {
  background-color: #348396 !important;
  border-color: #348396 !important;
}
.notificaciones-feed .btn-primary:hover {
  background-color: #2d7283 !important;
  border-color: #2d7283 !important;
}

/* DataTables: en móvil mantiene paginación visible como en escritorio */
@media (max-width: 767.98px) {
  .dataTables_wrapper {
    overflow-x: hidden;
  }
  .dataTables_wrapper .row {
    --bs-gutter-x: 0.5rem;
    row-gap: 0.5rem;
  }
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    text-align: left !important;
    width: 100%;
  }
  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select {
    width: auto;
    max-width: 100%;
  }
  .dataTables_wrapper .dataTables_filter label,
  .dataTables_wrapper .dataTables_length label {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0;
  }
  .dataTables_wrapper .row:last-child {
    flex-direction: column;
    align-items: stretch;
  }
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    width: 100%;
    text-align: center !important;
    margin-top: 0.5rem;
    float: none !important;
  }
  /* El tema oculta los números de página en móvil; los volvemos a mostrar */
  .dataTables_wrapper .dataTables_paginate li.paginate_button {
    display: inline-block !important;
    font-size: 0.875rem !important;
  }
  .dataTables_wrapper .dataTables_paginate li.paginate_button.next,
  .dataTables_wrapper .dataTables_paginate li.paginate_button.previous {
    font-size: 0.875rem !important;
  }
  .dataTables_wrapper .dataTables_paginate .pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 !important;
  }
  .dataTables_wrapper .dataTables_paginate .page-link {
    padding: 0.35rem 0.7rem;
  }
  .dataTables_wrapper .dataTables_scrollHead,
  .dataTables_wrapper .dataTables_scrollBody {
    -webkit-overflow-scrolling: touch;
  }
}

/* Comunicaciones: tarjetas para móvil (reemplaza la tabla por debajo de md) */
.comunicaciones-feed .comunicacion-card {
  border-radius: 0.75rem;
  border: 1px solid rgba(108, 95, 217, 0.12);
  border-left: 4px solid #6c5fd9;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.comunicaciones-feed .comunicacion-card__link {
  color: inherit;
  border-radius: inherit;
  overflow: hidden;
}
.comunicaciones-feed .comunicacion-card__link:active {
  background: rgba(108, 95, 217, 0.06);
}
.comunicaciones-feed .comunicacion-card:active {
  transform: scale(0.99);
  box-shadow: none !important;
}
.comunicaciones-feed .comunicacion-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(108, 95, 217, 0.12);
  color: #6c5fd9;
}
.comunicaciones-feed .comunicacion-card__title {
  color: #212529;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comunicaciones-feed .comunicacion-card__autor {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comunicaciones-feed .comunicacion-card__chevron {
  color: #adb5bd;
  font-size: 0.9rem;
}

/* Encabezado de página (Volver + título + acción): en móvil el título pasa
   a ocupar su propia fila arriba, y los botones quedan juntos debajo. */
@media (max-width: 767.98px) {
  .page-header-bar {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .page-header-bar__title {
    order: -1;
    flex: 1 1 100%;
    font-size: 1.15rem;
  }
  .page-header-bar__back {
    margin-right: auto !important;
  }
  .page-header-bar__action {
    margin-left: auto;
  }
}