@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&family=Roboto:ital,wght@0,300;0,400;1,300;1,400&family=Rubik:ital,wght@0,300;0,400;0,500;0,600;1,400;1,700&display=swap');
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css");
@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&display=swap");
/* 
font-family: 'Comfortaa', cursive;
font-family: 'Rubik', sans-serif;
font-family: 'Roboto', sans-serif;

colors 
primary #167c65
secondary #fdb913
CSS Document */
.custom-popover {
  border-color: red;
}
.custom-popover .popover-header {
  color: white;
  background-color: red;
}
/* Patient control panel
------------------------------*/
.bg-marca {
  background-color: #fdb913;
}
/* #alpha visibility now controlled by grid layout */
/* Fix para modales cargados vía fetch */
.modal-backdrop {
  z-index: 1040 !important;
}
.modal {
  z-index: 1050 !important;
}
.iabg{
    background-color: purple;
}
.iafn{
    color: purple;
}
#alpha .modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}
#epsilon {
  display: block;
  width: 100vw;
  height: 100vh;
  position: fixed;
  z-index: 10000;
  background-color: #FFF
}
html {
  height: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
  font-family: 'Comfortaa', cursive;
  font-size: 12px;
}
a {
  text-decoration: none;
}
[data-toggle="buttons"] > label:required, .cke:required, textarea:required, select:required, input:required {
  border: 1px solid #FF6700 !important;
}
select[multiple] {
  height: auto !important;
  background-color: #f8f9fa !important;
  padding: 2rem 0.5rem !important;
}
select option {
  padding: 3px 5px;
  line-height: 1.5;
}
.marker {
  background-color: coral;
  padding: 3px;
}
[data-toggle="buttons"] label.btn-dark {
  background-color: #212529;
}
[data-toggle="buttons"] label.btn-dark.active {
  background-color: #157347;
}
input[type="number"] {
  text-align: end;
}
input[type="checkbox"], input[type="radio"] {
  box-sizing: border-box;
  padding: 0;
  margin: 4px 0 0;
}
input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
textarea.form-textarea {
  min-height: 250px !important;
}
textarea.pac-textarea {
  min-height: 150px !important;
}
[data-toggle="buttons"] > .btn > input[type="radio"], [data-toggle="buttons"] > .btn > input[type="checkbox"] {
  display: none;
}
::-webkit-scrollbar {
  width: 6px; /* Ancho de la barra de desplazamiento */
}
::-webkit-scrollbar-thumb {
  background-color: #888; /* Color del pulgar */
  border-radius: 3px; /* Borde redondeado */
}
::-webkit-scrollbar-track {
  background-color: #f1f1f1;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}
.btn.btn-dark {
  background-color: #5B5B5B;
}
.btn.btn-dark:hover, .btn.btn-dark:focus {
  background-color: #000;
}
.btn.btn-dark.active {
  background-color: #000;
  text-decoration: none;
}
.btn.btn-marca {
  background-color: #343a40;
  color: white;
}
.btn.btn-marca:hover, .btn.btn-marca:focus {
  background-color: #0a3622;
}
.btn.btn-marca.active {
  background-color: #198754;
  text-decoration: none;
}
.w-15 {
  width: 15%;
}
.w-85 {
  width: 84%;
}
.w-18 {
  width: 18%;
}
.w-33 {
  width: 33.34%;
}
.w-49 {
  width: 49%;
}
.vh-25 {
  height: 25vh;
  overflow: auto;
}
.vh-50 {
  height: 50vh;
  overflow: auto;
}
.vh-65 {
  height: 65vh;
  overflow: auto;
}
.vh-75 {
  height: 75vh;
  overflow: auto;
}
.npoint {
  cursor: default !important;
}
.cpoint {
  cursor: pointer;
}
.h50 {
  height: 120px;
}
.table-fixed {
  table-layout: fixed;
  width: 100%;
}
/* Login */
#togglePassword {
  position: absolute;
  right: 15px;
  top: 8px;
}
.form-signin {
  width: 100%;
  max-width: 330px;
  padding: 15px;
  margin: auto;
}
.form-signin .checkbox {
  font-weight: 400;
}
.form-signin .form-floating:focus-within {
  z-index: 2;
}
.form-signin select {
  margin-bottom: -1px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}
.form-signin input[type="email"] {
  margin-bottom: -1px;
  border-radius: 0;
}
.form-signin input[type="text"], .form-signin input[type="password"] {
  margin-bottom: 10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
/* End login */
/* Layout responsive con Grid */
body {
  font-family: 'Comfortaa', cursive;
  font-size: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "sidebar topsearch"
    "sidebar alpha";
  height: 100vh;
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-position: top left;
  background-repeat: no-repeat;
  background-size: cover;     
}
aside {
  grid-area: sidebar;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  width: auto; /* Ancho automático basado en contenido */
  min-width: auto;
  overflow: hidden; /* Sin overflow */
  z-index: 100;
  background-color: #f8f9fa;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  padding: 0 5px; /* Pequeño padding */
}
/* NO hay comportamiento hover - el aside nunca se expande */
/* Dropdowns completamente fuera del aside usando position: fixed */
aside .nav-item.dropdown {
  position: static; /* Rompe el contexto de posicionamiento */
}
aside .dropdown-menu {
  position: fixed !important; /* Posición fija respecto al viewport */
  left: auto !important;
  top: auto !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1050;
}
/* JavaScript calculará la posición, pero establecemos un fallback */
aside .dropdown-menu.show {
  /* La posición será calculada por Bootstrap, pero forzamos que esté a la derecha */
  margin-left: 0 !important;
}
aside .link-dark span a {
  color: #000;
}
aside .link-dark:hover {
  background-color: #DDD;
  color: #000;
}
#liveAlertPlaceholder {
  position: fixed;
  overflow: hidden;
  height: auto;
  width: auto;
  top: 0px;
  left: 20vw;
  z-index: 10;
}
#alphaPrime {
  grid-area: alpha;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 60px); /* Altura total menos altura de topsearch */
  min-height: calc(100vh - 60px);
  width: 100%;
  padding: 0 10px;
  margin: 0;
  z-index: 99;
  background-repeat: no-repeat;
  background-size: cover;
}
#alpha {
  grid-area: alpha;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 60px); /* Altura total menos altura de topsearch */
  min-height: calc(100vh - 60px);
  width: 100%;
  padding: 0 10px;
  margin: 0;
  z-index: 99;
}
footer {
  position: fixed;
  bottom: 0px;
  left: 0;
  width: 100vw;
  height: auto;
  font-size: 0.6rem;
  line-height: 10px;
  padding: 5px 0;
  text-align: center;
  z-index: 98;
  box-shadow: 0px -15px 32px -14px rgba(0, 0, 0, 0.90);
  background-color: rgba(48, 48, 48, 0.5);
}
/* Elementos dentro de #topsearch - ahora usan flexbox */
#alerts {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 0;
  font-size: 1rem;
}
#alphaHelp {
  position: relative;
  flex: 2;
  text-align: center;
  font-weight: 600;
}
#ntfcns {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #343a40;
}
time {
  position: relative;
  padding: 5px 12px;
  border-radius: 5px;
  background-color: #3D7AF3;
  color: #FFF;
  font-size: 0.9rem;
  font-family: 'Roboto', sans-serif;
  white-space: nowrap;
}
#help {
  position: relative;
  padding: 0 10px;
  font-size: 1.8rem;
  color: #28a745;
  cursor: pointer;
}
#topsearch {
  grid-area: topsearch;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 60px;
  min-height: 60px;
  padding: 0 20px;
  font-size: 1rem;
  z-index: 100;
  background-color: rgba(126, 126, 126, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}
/*navbar-dark bg-dark text-white*/
#nav-h a.nav-link {
  color: #FFF;
}
#nav-h {
  background-color: #151414;
  margin-top: 2px;
  margin-left: 8px;
  color: #000;
  background: rgb(213, 213, 213);
  background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(213, 213, 213, 1) 60%, rgba(48, 48, 48, 1) 100%) !important;
  border: 1px solid rgba(48, 48, 48, 0.5);
}
#nav-h .nav-item a.nav-link {
  color: #000;
}
#nav-h .nav-item.tabaco a.nav-link {
  color: #FFF !important;
  background-color: #575FF5;
}
#nav-h .nav-item.tabaco a.nav-link:hover, #nav-h .nav-item a.nav-link:hover {
  color: #FFF !important;
  background-color: #0038BB;
}
h6.fw-bolder {
  color: blue;
}
#message .nav-pills .nav-link.active, #message .nav-pills .show > .nav-link {
  color: #000;
  background-color: #f8f9fa
}
.wrapper {
  box-shadow: 0px 0px 21px 2px rgba(3, 51, 51, 0.50);
  background: rgba(240, 240, 240, 0.75);
  padding: 1%;
  border-radius: 5px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0px;
  margin-left: 8px;
  height: calc(100vh - 140px) !important;
  overflow-y: auto;
  overflow-x: hidden;
}
.wrapper-nofix {
  padding: 1%;
  border-radius: 5px;
  margin-top: 0px;
  height: calc(100vh - 120px) !important;
  overflow-y: hidden;
  overflow-x: hidden;
}
.container-fix {
  height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
}
.container-subfix {
  height: calc(100vh - 260px);
  overflow-y: auto;
  overflow-x: hidden;
}
.inneWrapper {
  background: rgba(240, 240, 240, 0.75);
  padding: 1%;
  border-radius: 5px;
  height: auto;
}
.dropdown-menu {
  margin-left: 7.5rem !important;
  margin-top: -48px !important;
}
.xl {
  width: 200px !important;
}
.xl .nav-item {
  padding: 5px 3px !important;
  border-bottom: 1px solid #CCC;
}
.nav-item {
  padding: 0px !important;
}
.nav-item span.small {
  font-size: 0.65rem;
  color: #828282;
}
.modal-fullscreen {
  width: 86vw;
  height: calc(100vh - 60px);
  max-width: none;
  margin: 30px auto
}
.modal-fullscreen .modal-content {
  height: 100%;
  border: 1px solid #333;
  border-radius: 5px
}
.caja {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Rubik', sans-serif;
}
.has-error {
  border-width: 5px;
}
.nav-tune a.nav-link {
  border-left: 2px solid darkblue;
  border-right: 2px solid darkblue;
  cursor: pointer;
  border-radius: 3px;
  margin-right: 3px;
}
/* RESPONSIVE */

/* Mobile y tablet - ocultar aside por defecto */
@media (max-width: 991.98px) {
  body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topsearch"
      "alpha";
  }

  aside {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 1100;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  }

  aside.show {
    left: 0;
  }

  /* Overlay para cerrar el sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  .sidebar-overlay.show {
    display: block;
    opacity: 1;
  }

  /* Ajustar el área de contenido */
  #alpha {
    width: 100%;
    padding: 0 5px;
  }

  /* Mostrar el botón del menú en móvil */
  #toggleSidebar {
    display: inline-block !important;
  }

  /* Optimizar topsearch para móvil/tablet */
  #topsearch {
    padding: 0 8px;
    gap: 5px;
    flex-wrap: nowrap;
  }

  /* Dar más espacio a #alerts */
  #alerts {
    flex: 2;
    gap: 5px;
    min-width: 0;
  }

  /* Ocultar #alphaHelp en móvil */
  #alphaHelp {
    display: none;
  }

  /* Hacer más compacto el span de razón social */
  #rzsoc {
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  /* Botones más compactos en móvil */
  #alerts .btn {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  /* Notificaciones más compactas */
  #ntfcns {
    gap: 5px;
    padding: 0 !important;
  }

  #ntfcns .btn {
    padding: 4px 8px;
  }

  #ntfcns .h5 {
    font-size: 1rem !important;
  }

  /* Time más compacto */
  time {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  /* Help icon más pequeño */
  #help {
    font-size: 1.3rem;
    padding: 0 5px;
  }
}

/* Móviles pequeños - ajustes adicionales */
@media (max-width: 576px) {
  #topsearch {
    padding: 0 5px;
  }

  /* Ocultar el reloj en móviles muy pequeños */
  time {
    display: none;
  }

  /* Reducir aún más el texto de razón social */
  #rzsoc {
    max-width: 120px;
    font-size: 0.65rem !important;
  }

  /* Botón fullscreen solo icono */
  #toggleFullscreen {
    padding: 6px 8px;
  }

  /* Hacer los badges de notificaciones más pequeños */
  #ntfcns span.rounded-circle {
    font-size: 0.7rem;
    padding: 2px 6px !important;
  }
}

@media (min-width:1200px) {
  /* Grid layout handles aside positioning */
  aside {
    padding: 0 5px;
  }
  /* Mantener el ancho del sidebar extendido en pantallas grandes */
  aside:not(:hover) {
    width: auto;
    min-width: 60px;
  }
  footer {
    font-size: 0.9rem;
    width: 100vw;
  }
  .wrapper {
    margin-top: 20px;
    height: calc(100vh - 100px);
  }
  html, body {
    font-size: 16px;
  }
}

@media (min-width:992px) {
  html, body {
    font-size: 14px;
  }

  /* Ocultar el botón del menú en desktop */
  #toggleSidebar {
    display: none !important;
  }
}

@media (min-width:768px) {
  /* Grid layout handles #alpha visibility */
  #epsilon {
    display: none
  }
}

/*//////////// signature ///////////////*/
.signature-container {
  border: 3px dashed #667eea;
  border-radius: 15px;
  padding: 20px;
  background: #fafafa;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.signature-label {
  color: #667eea;
  font-weight: 600;
  margin-bottom: 15px;
  font-size: 1.1rem;
}
#signatureCanvas {
  width: 90%;
  height: 300px;
  border: 2px solid #ddd;
  border-radius: 10px;
  cursor: crosshair;
  background: white;
  display: block;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
#signatureCanvas:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}
.signature-controls {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-sign {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-clear {
  background: #ff6b6b;
  color: white;
}
.btn-clear:hover {
  background: #ff5252;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}
.btn-save {
  background: #4ecdc4;
  color: white;
}
.btn-save:hover {
  background: #26d0ce;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}
.btn-submit {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 15px 40px;
  font-size: 16px;
  border-radius: 30px;
  width: 100%;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}
.btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}
.btn-submit:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}
.btn-submit:hover:before {
  left: 100%;
}
.signature-info {
  color: #888;
  font-size: 0.9rem;
  margin-top: 10px;
  font-style: italic;
}
.signature-status {
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
}
.status-empty {
  background: #fff3cd;
  color: #856404;
}
.status-signed {
  background: #d4edda;
  color: #155724;
}
.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}
/* Animación del badge de mensajes */
@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0);
  }
}
#timerMessage.pulse-animation {
  animation: pulse-badge 0.6s ease-in-out 3;
}
/* Efecto de brillo al aparecer */
#timerMessage {
  transition: all 0.3s ease;
}
#timerMessage:not(.d-none) {
  animation: fade-in 0.3s ease;
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* Badge hover effect */
#timerMessage:hover {
  transform: scale(1.15);
  cursor: pointer;
}
/*////////////// IFRAME DOCS /////////////////*/
/* Overlay frontal dentro del modal */
#modalInlineOverlay {
  position: absolute;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  background: rgba(255, 255, 255, 0.98);
  z-index: 1060; /* > bootstrap modal-content */
  padding: 1rem;
  overflow: auto;
  display: none;
}
#modalInlineOverlay .overlay-controls {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
}
#modalInlineOverlay .overlay-body {
  min-height: 300px;
}
/* imagen responsive */
#modalInlineOverlay img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
/* mensaje fallback */
.overlay-error {
  padding: 2rem;
  text-align: center;
  color: #a00;
}
/*////////////// print /////////////////*/
@media print {
  .alert,    
  button {
    display: none;
  }
    
}

/*////////////////////CALENDARIO/////////////////////////*/
.calendar-wrapper {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.calendar-header {
  background: #f8f9fa;
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
}

.calendar-header .col {
  padding: 10px 0;
  border-left: 1px solid #dee2e6;
}

.time-col {
  width: 80px;
  min-width: 80px;
  text-align: right;
  padding-right: 8px;
  font-size: 0.85rem;
  color: #6c757d;
}

.calendar-row {
  min-height: 70px;
  border-bottom: 1px solid #f1f1f1;
}

.calendar-cell {
  border-left: 1px solid #f1f1f1;
  padding: 4px;
}

.cell-content {
  height: 100%;
  background: #fdfdfd;
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

.cell-text {
  font-size: 0.8rem;
  color: #495057;
}

/* Vista mensual */
.cal-grid .row { border-bottom: 1px solid #e9ecef; }
.cal-grid .row:last-child { border-bottom: none; }

.cal-day {
  min-height: 110px;
  border-right: 1px solid #e9ecef;
  padding: 4px 6px;
  cursor: default;
  transition: background-color 0.15s;
}
.cal-day:last-child { border-right: none; }
.cal-day:hover { background-color: #f8f9fa; }

.cal-day-today { background-color: #e8f0fe !important; }
.cal-day-other { opacity: 0.4; background-color: #fafafa; }

.cal-day-header {
  margin-bottom: 4px;
}
.cal-day-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
}
.cal-day-today .cal-day-num.badge {
  font-size: 0.8rem;
  padding: 3px 7px;
}

.cal-add-btn {
  opacity: 0;
  padding: 0 4px;
  font-size: 0.8rem;
  line-height: 1;
  border: none;
  background: none;
  color: #0d6efd;
  transition: opacity 0.15s;
}
.cal-day:hover .cal-add-btn { opacity: 1; }

.cal-event {
  font-size: 0.75rem;
  padding: 2px 6px;
  margin-bottom: 2px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.1s, box-shadow 0.1s;
}
.cal-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.cal-event-title { font-weight: 500; }

/* ====== SIDEBAR CALENDARIO ====== */
.cal-sidebar {
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Mini calendario del mes */
.cal-mini-month { user-select: none; }
.cal-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: center;
}
.cal-mini-table th {
  padding: 2px;
  color: #6c757d;
  font-weight: 600;
  font-size: 0.7rem;
}
.cal-mini-table td {
  padding: 2px;
  width: 14.28%;
}
.cal-mini-table td a {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  border-radius: 50%;
  color: #495057;
  text-decoration: none;
  transition: background-color 0.15s;
}
.cal-mini-table td a:hover {
  background-color: #e2e6ea;
}
.cal-mini-today a {
  background-color: #0d6efd !important;
  color: #fff !important;
  font-weight: 700;
}
.cal-mini-selected a {
  background-color: #e8f0fe !important;
  color: #0d6efd !important;
  font-weight: 600;
}

/* Navegación de secciones en sidebar */
.cal-nav-sections {
  max-height: 40vh;
  overflow-y: auto;
}
.cal-nav-group {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 4px;
}
.cal-nav-header {
  padding: 4px 6px;
  color: #495057;
  font-size: 0.8rem;
}
.cal-nav-link {
  display: block;
  padding: 3px 6px 3px 18px;
  color: #6c757d;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.15s, color 0.15s;
}
.cal-nav-link:hover {
  background-color: #e2e6ea;
  color: #212529;
}

/* ====== VISTA SEMANAL ====== */
.cal-week-grid {
  overflow-y: auto;
  max-height: calc(100vh - 310px);
}
.cal-week-grid .calendar-row {
  min-height: 60px;
}
.cal-week-grid .calendar-cell {
  position: relative;
  min-height: 60px;
}
.cal-week-grid .calendar-cell .cal-event {
  margin-bottom: 2px;
}

.cal-add-btn-hour {
  opacity: 0;
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  font-size: 0.85rem;
  line-height: 20px;
  text-align: center;
  padding: 0;
  border: none;
  background: #e8f0fe;
  color: #0d6efd;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s;
}
.calendar-cell:hover .cal-add-btn-hour,
.cal-day-row:hover .cal-add-btn-hour { opacity: 1; }
.cal-add-btn-hour:hover {
  background: #0d6efd;
  color: #fff;
}

/* ====== VISTA DIARIA ====== */
.cal-day-view {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
}
.cal-day-row {
  min-height: 70px;
  border-bottom: 1px solid #f1f1f1;
  transition: background-color 0.1s;
}
.cal-day-row:hover {
  background-color: #fdfdfd;
}
.cal-hour-now {
  background-color: #fffde7 !important;
  border-left: 3px solid #ffc107;
}
.cal-event-day {
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 6px;
  cursor: pointer;
  white-space: normal;
  transition: transform 0.1s, box-shadow 0.1s;
}
.cal-event-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* Botón + ancho en vista diaria (celdas sin eventos) */
.cal-day-view .cal-add-btn-hour {
  position: relative;
  opacity: 0;
  width: 100%;
  height: 100%;
  min-height: 50px;
  border-radius: 6px;
  background: transparent;
  bottom: auto;
  right: auto;
  font-size: 1rem;
  color: #adb5bd;
}
.cal-day-view .calendar-cell:hover .cal-add-btn-hour {
  opacity: 1;
  background: #f8f9fa;
}

/* ====== RESPONSIVE CALENDARIO ====== */
@media (max-width: 767px) {
  .cal-day { min-height: 60px; padding: 2px; }
  .cal-day-num { font-size: 0.75rem; }
  .cal-event { font-size: 0.65rem; padding: 1px 3px; }
  .cal-add-btn { opacity: 1; }
  .calendar-header .col { font-size: 0.75rem; padding: 6px 0; }
  .cal-sidebar { display: none !important; }
  .cal-week-grid { max-height: none; }
  .cal-day-view { max-height: none; }
  .cal-week-grid .calendar-cell { min-height: 45px; }
  .cal-add-btn-hour { opacity: 1; }
  .time-col { width: 50px; min-width: 50px; font-size: 0.7rem; }
}

/* ====== IA STYLES ====== */
/**
 * Estilos para Integración de IA
 * OrionAI - Sistema de Gestión
 */

/* Offcanvas IA - Ancho 50% */
.offcanvas-ia-wide {
    width: 50% !important;
    max-width: 50% !important;
}

/* Contenedor principal de IA */
.ia-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

/* Botón de IA (estrella) */
.iabg {
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulseIA 2s infinite;
}

.iabg:hover {
    transform: scale(1.1);
    color: #ffc107 !important;
}

@keyframes pulseIA {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Área de resultados */
.ia-results {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.ia-results .card {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sugerencias rápidas */
.ia-suggestion {
    transition: all 0.2s ease;
    cursor: pointer;
}

.ia-suggestion:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Loading spinner */
#ia-loading {
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Tablas de resultados */
.ia-results table {
    font-size: 0.9rem;
    background: white;
}

.ia-results table th {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #90caf9;
}

.ia-results table tbody tr {
    background: white;
}

.ia-results table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Cards de análisis */
.ia-results .card {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    background: white;
}

.ia-results .card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.ia-results .card-header.bg-primary {
    background: #e3f2fd !important;
    color: #1976d2 !important;
    border-bottom-color: #90caf9 !important;
}

.ia-results .card-header.bg-info {
    background: #e0f7fa !important;
    color: #0097a7 !important;
    border-bottom-color: #80deea !important;
}

.ia-results .card-header.bg-success {
    background: #e8f5e9 !important;
    color: #388e3c !important;
    border-bottom-color: #81c784 !important;
}

.ia-results .card-body {
    background: white;
}

.ia-results .list-unstyled li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.ia-results .list-unstyled li:last-child {
    border-bottom: none;
}

/* Badges de IA */
.ia-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.ia-badge-critical {
    background-color: #dc3545;
    color: white;
}

.ia-badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.ia-badge-info {
    background-color: #0dcaf0;
    color: #212529;
}

.ia-badge-success {
    background-color: #198754;
    color: white;
}

/* Input de consulta */
#ia-input {
    border: 2px solid #dee2e6;
    transition: border-color 0.3s ease;
}

#ia-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Botón de enviar */
#ia-send-btn {
    min-width: 60px;
}

#ia-send-btn:hover {
    transform: scale(1.05);
}

/* Detalles (SQL generado) */
details summary {
    font-size: 0.875rem;
    padding: 0.5rem;
}

details summary:hover {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

details pre {
    font-size: 0.8rem;
    max-height: 300px;
    overflow: auto;
}

/* Offcanvas personalizado para IA */
#topcanvas {
    height: 100vh !important;
    background: #f8f9fa;
}

#topcanvas .offcanvas-body {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    background: #ffffff;
}

#topcanvas .offcanvas-header {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    flex-shrink: 0;
    border-bottom: 2px solid #90caf9;
}

#topcanvas .offcanvas-header .btn-close {
    opacity: 0.8;
}

#topcanvas .offcanvas-header .offcanvas-title {
    font-weight: 600;
}

#topcanvas .offcanvas-header .offcanvas-title i {
    color: #ffc107;
}

/* Iconos de contexto */
.ia-context-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Animación de escritura */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.ia-typing {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 1s steps(40, end);
}

/* Responsive */
@media (max-width: 1200px) {
    .offcanvas-ia-wide {
        width: 60% !important;
        max-width: 60% !important;
    }
}

@media (max-width: 992px) {
    .offcanvas-ia-wide {
        width: 75% !important;
        max-width: 75% !important;
    }
}

@media (max-width: 768px) {
    .offcanvas-ia-wide {
        width: 90% !important;
        max-width: 90% !important;
    }

    .ia-container {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .offcanvas-ia-wide {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Estilos adicionales para claridad */
.ia-container .alert-info {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}

/* Guía de uso rápida */
.ia-help-guide {
    background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
    border: 2px solid #ffd54f;
    border-radius: 0.5rem;
    padding: 0;
    overflow: hidden;
}

.ia-help-summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    color: #f57c00;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-bottom: 1px solid #ffd54f;
    transition: all 0.2s ease;
    list-style: none;
}

.ia-help-summary::-webkit-details-marker {
    display: none;
}

.ia-help-summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

details[open].ia-help-guide .ia-help-summary::before {
    transform: rotate(90deg);
}

.ia-help-summary:hover {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
    color: #e65100;
}

.ia-help-content {
    padding: 1rem;
    background: white;
    animation: fadeInDown 0.3s ease;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ia-help-content h6 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.ia-help-content ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.ia-help-content ul li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.ia-help-content .small {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Card de extracción de imagen */
.ia-container .card.border-light {
    border: 1px solid #e0e0e0;
    background: white;
}

.ia-container .card.border-light .card-header {
    background: #f8f9fa;
    color: #495057;
    font-weight: 500;
    border-bottom: 1px solid #e0e0e0;
}

#ia-image-input {
    font-size: 0.9rem;
}

#ia-extract-btn {
    transition: all 0.2s ease;
}

#ia-extract-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

details {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

details[open] {
    background: white;
}

details summary {
    color: #1976d2;
    font-weight: 500;
}

details pre {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6;
}

/* Modo oscuro deshabilitado para mantener vista clara */

