/* Custom CSS - Archivo para estilos personalizados */

/* CONTENEDOR - ALINEAR CON EL WIDGET */
.quick-actions {
  margin: 0 0 0 0;
  padding: 0;
  /* Asegurar que tenga los mismos márgenes negativos que otras filas */
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

/* REDUCIR PADDING VERTICAL DE LAS COLUMNAS DE LAS TARJETAS */
.quick-actions .col-xs-6 {
  padding-top: 0.5rem;

  /* El padding lateral ya está definido por Bootstrap/core.css (0.75rem) */
}

/* CARD BASE */
.quick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  height: 90px;
  background: #ffffff;
  border-radius: 14px;
  text-decoration: none;

  color: #666;
  font-weight: 600;
  text-align: center;

  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.08);
  overflow: hidden; /* CLAVE */
}

/* BANDA IZQUIERDA */
.quick-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;

  width: 10px;
  height: 100%;

  border-radius: 14px 0 0 14px;
}

/* COLORES DE BANDA */
.quick-card.alert::before {
  background-color: #f5a623;
}

.quick-card.order::before {
  background-color: #3ac569;
}

/* ICONO */
.quick-card i {
  font-size: 26px;
  margin-bottom: 8px;
  color: #666;
}

/* TEXTO */
.quick-card span {
  font-size: 14px;
}

/* FEEDBACK TÁCTIL */
.quick-card:active {
  transform: scale(0.97);
  background-color: #f8f9fa;
}

/* TÍTULOS DE PÁGINAS A 28PX */
.widget-title,
h1.widget-title,
h2.widget-title,
h3.widget-title,
h4.widget-title,
h5.widget-title,
h6.widget-title {
  font-size: 28px !important;
}

/* BORDES REDONDOS A 14PX PARA TODOS LOS CONTENEDORES */
.widget,
.widget-body,
.widget-header,
.widget-footer {
  border-radius: 14px;
}

/* SUBTÍTULOS */
.widget-header .widget-subtitle {
  font-size: 14px !important;
  color: #666 !important;
  font-weight: 400 !important;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  display: block !important;
  line-height: 1.4 !important;
  width: 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 20px !important;
  clear: both !important;
}

/* Asegurar que el widget-header muestre el contenido */
.widget-header {
  overflow: visible !important;
}

/* COLOR DEL NAVBAR/APPBAR */
#app-navbar.navbar-inverse.primary,
.navbar-inverse.primary,
.navbar-inverse.primary.navbar {
  background-color: #043362 !important;
  border-color: #043362 !important;
}

/* CENTRAR EL LOGO DEL NAVBAR */
.navbar-brand {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  text-align: center !important;
}

.navbar-brand .brand-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
}

.navbar-brand .brand-icon img {
  display: block !important;
  margin: 0 auto !important;
  max-width: 100% !important;
  height: auto !important;
}

/* ESTILOS RESPONSIVE PARA MÓVILES */
@media (max-width: 767px) {
  .navbar-brand {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    width: auto !important;
    padding: 16px 10px !important;
  }
  
  .navbar-brand .brand-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }
  
  .navbar-brand .brand-icon img {
    max-height: 45px !important;
    max-width: 120px !important;
    width: auto !important;
    height: auto !important;
  }
}

/* ESTILOS PARA TABLETS */
@media (min-width: 768px) and (max-width: 991px) {
  .navbar-brand .brand-icon img {
    max-height: 50px !important;
    max-width: 140px !important;
  }
}

/* CAMBIAR COLOR AZUL POR DEFECTO AL COLOR CORPORATIVO #043362 */
.theme-color {
  color: #043362 !important;
}

.bg-primary, .primary {
  background-color: #043362 !important;
  color: #fff !important;
}

.text-primary {
  color: #043362 !important;
}

.b-primary {
  border-color: #043362 !important;
}

.btn-primary {
  background-color: #043362 !important;
  border-color: #043362 !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus {
  background-color: #032a4d !important;
  border-color: #032a4d !important;
}

.btn-primary:active,
.btn-primary.active,
.open > .btn-primary.dropdown-toggle {
  background-color: #021f38 !important;
  border-color: #021f38 !important;
}

.badge-primary {
  background-color: #043362 !important;
}

.panel-custom.panel-primary {
  border-top-color: #043362 !important;
  border-bottom-color: #043362 !important;
}

.panel-custom.panel-primary .panel-title {
  color: #043362 !important;
}

/* Cambiar color en navbar-inverse de bootstrap */
.navbar-inverse {
  background-color: #043362 !important;
  border-color: #043362 !important;
}

/* Cambiar enlaces y elementos que usen el color primario */
a.text-primary,
a.text-primary:hover,
a.text-primary:focus {
  color: #043362 !important;
}

/* Cambiar en misc-pages.css si se usa */
.misc-pages .text-primary {
  color: #043362 !important;
}

/* Cambiar en landing-page.css si se usa */
#footer .news .text-primary {
  color: #043362 !important;
}

/* CAMBIAR COLOR DEL ITEM SELECCIONADO/ACTIVO EN EL DRAWER */
.app-menu li.open > a,
.app-menu li.active > a,
.app-menu li:hover > a,
.app-menu li.menu-heading > a {
  color: #043362 !important;
}

body.menubar-left .app-menu li.open,
body.menubar-left .app-menu li.active {
  border-left-color: #043362 !important;
}

.theme-primary .menubar .app-menu li.active,
.theme-primary .menubar .app-menu li.open {
  border-left-color: #043362 !important;
}

.theme-primary .menubar .app-menu li.open > a,
.theme-primary .menubar .app-menu li.active > a,
.theme-primary .menubar .app-menu li:hover > a,
.theme-primary .menubar .app-menu li.menu-heading > a {
  color: #043362 !important;
}

/* ESTILOS PARA FAQ - ACORDEÓN */
.panel-group .panel {
  border-radius: 14px;
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
}

.panel-group .panel-heading {
  background-color: #f8f9fa;
  border-radius: 14px 14px 0 0;
  padding: 15px 20px;
}

.panel-group .panel-heading .panel-title a {
  color: #333;
  text-decoration: none;
  font-weight: 600;
  display: block;
}

.panel-group .panel-heading .panel-title a:hover,
.panel-group .panel-heading .panel-title a:focus {
  color: #043362;
  text-decoration: none;
}

.panel-group .panel-heading .panel-title a[aria-expanded="true"] {
  color: #043362;
}

.panel-group .panel-heading .panel-title .fa-question-circle {
  color: #043362;
  margin-right: 8px;
}

.panel-group .panel-body {
  padding: 20px;
  color: #666;
  line-height: 1.6;
}

.panel-group .panel-collapse {
  border-radius: 0 0 14px 14px;
}

/* TÍTULO SECUNDARIO MÁS PEQUEÑO QUE EL PRINCIPAL */
.widget-title-secondary,
h5.widget-title-secondary,
h4.widget-title-secondary,
h3.widget-title-secondary,
h2.widget-title-secondary,
h1.widget-title-secondary,
h5.widget-title.widget-title-secondary,
h4.widget-title.widget-title-secondary,
h3.widget-title.widget-title-secondary,
h2.widget-title.widget-title-secondary,
h1.widget-title.widget-title-secondary {
  font-size: 20px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  color: #333 !important;
}

/* ESTILOS PARA ICONOS EN INPUTS */
.input-group-addon {
  background-color: #f5f5f5;
  border-color: #ddd;
  color: #666;
}

.input-group-addon i {
  width: 14px;
  text-align: center;
}

/* ESTILO PARA INPUT FILE CON ICONO */
.input-group input[type="file"] {
  border: 1px solid #ddd;
  border-left: none;
  border-radius: 0 4px 4px 0;
}

.input-group input[type="file"]:focus {
  border-color: #043362;
  outline: 0;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(4, 51, 98, 0.6);
}

/* ESTILO PARA TEXTAREA CON ICONO */
.input-group textarea {
  border-left: none;
  border-radius: 0 4px 4px 0;
}

.input-group-addon[style*="vertical-align: top"] {
  border-radius: 4px 0 0 4px;
  border-right: none;
}

/* ESTILO PARA SELECT CON ICONO */
.input-group select {
  border-left: none;
  border-radius: 0 4px 4px 0;
}

/* ESTILOS PARA INPUT-GROUP EN INFORMACIÓN PERSONAL */
.clearfix .input-group.myInput {
  width: 100%;
  float: right;
  margin-top: 5px;
  clear: both;
}

.clearfix .input-group.myInput .form-control {
  width: 100%;
}

/* Asegurar que los input-group se muestren correctamente al editar */
.panel-body .clearfix .input-group.myInput {
  display: block !important;
  clear: both;
  width: 100%;
  margin-top: 5px;
  float: right;
}

/* Ajustar el ancho del input dentro del input-group */
.panel-body .clearfix .input-group.myInput input,
.panel-body .clearfix .input-group.myInput select {
  width: 100% !important;
}

/* CAMBIAR COLOR DE LOS PANELES PRIMARY (CONTENEDORES CON FONDO AZUL) */
.panel-primary {
  border-color: #043362 !important;
}

.panel-primary > .panel-heading {
  color: #fff !important;
  background-color: #043362 !important;
  border-color: #043362 !important;
}

.panel-primary > .panel-heading + .panel-collapse > .panel-body {
  border-top-color: #043362 !important;
}

.panel-primary > .panel-heading .badge {
  color: #043362 !important;
  background-color: #fff !important;
}

.panel-primary > .panel-footer + .panel-collapse > .panel-body {
  border-bottom-color: #043362 !important;
}

/* ============================================
   MEJORAS RESPONSIVE Y UI/UX MODERNAS
   ============================================ */

/* ========== MEJORAS GENERALES ========== */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== MEJORAS PARA FORMULARIOS ========== */
.form-control {
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 10px 15px;
  font-size: 14px;
  transition: all 0.3s ease;
  height: auto;
}

.form-control:focus {
  border-color: #043362;
  box-shadow: 0 0 0 3px rgba(4, 51, 98, 0.1);
  outline: none;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label,
.form-group span {
  display: block;
 
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

/* Formularios inline responsive */
.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.form-inline .form-group {
  flex: 1 1 auto;
  min-width: 150px;
  margin-bottom: 0;
}

/* ========== MEJORAS PARA BOTONES ========== */
.btn {
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-success {
  background-color: #28a745;
  color: #fff;
}

.btn-success:hover {
  background-color: #218838;
}

.btn-danger {
  background-color: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-info {
  background-color: #17a2b8;
  color: #fff;
}

.btn-info:hover {
  background-color: #138496;
}

/* ========== MEJORAS PARA TABLAS DATATABLES ========== */
.dataTables_wrapper {
  overflow-x: auto;
}

.table {
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
  padding: 12px 15px;
  font-size: 14px;
}

.table tbody td {
  padding: 12px 15px;
  font-size: 14px;
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #ffffff;
}

.table-striped > tbody > tr:nth-of-type(odd):hover {
  background-color: #f8f9fa;
}

/* Enlaces en tablas */
.table a {
  color: #043362;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.table a:hover {
  color: #032a4d;
  text-decoration: underline;
}

/* ========== MEJORAS PARA WIDGETS ========== */
.widget {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 25px;
  transition: box-shadow 0.3s ease;
}

.widget:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.widget-header {
  padding: 20px 25px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #fafafa;
}

.widget-body {
  padding: 25px;
}

.widget-separator {
  margin: 0;
  border-top: 1px solid #e0e0e0;
}

/* ========== MEJORAS PARA MENÚ LATERAL (SIDEBAR) ========== */
.menubar {
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.app-menu li a {
  padding: 12px 20px;
  transition: all 0.3s ease;
  border-radius: 0;
}

.app-menu li a:hover {
  background-color: rgba(4, 51, 98, 0.08);
  padding-left: 25px;
}

.app-menu li.active > a {
  background-color: rgba(4, 51, 98, 0.1);
  border-left: 4px solid #043362;
  padding-left: 16px;
}

.app-menu .submenu li a {
  padding-left: 50px;
}

.app-menu .submenu li a:hover {
  padding-left: 55px;
}

/* ========== MEJORAS PARA NAVBAR ========== */
#app-navbar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-toggle {
  border: none;
  padding: 8px 10px;
}

.navbar-toggle:focus {
  outline: none;
}

/* ========== MEJORAS PARA INPUT GROUPS ========== */
.input-group {
  display: flex;
  width: 100%;
}

.input-group-addon {
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px 0 0 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
}

.input-group .form-control {
  border-radius: 0 8px 8px 0;
  border-left: none;
}

.input-group .form-control:focus {
  border-left: 1px solid #043362;
}

/* ========== MEJORAS PARA ALERTAS ========== */
.alert {
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  border: none;
  font-size: 14px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

/* ========== MEJORAS PARA TARJETAS RÁPIDAS ========== */
.quick-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.quick-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.quick-card:active {
  transform: translateY(-2px);
}

/* ========== MEJORAS RESPONSIVE PARA MÓVIL ========== */
@media (max-width: 767px) {
  /* Ajustes generales */
  .wrap {
    padding: 10px;
  }

  /* Widgets */
  .widget-header {
    padding: 15px;
  }

  .widget-body {
    padding: 15px;
  }

  .widget-title {
    font-size: 22px !important;
  }

  .widget-title-secondary {
    font-size: 18px !important;
  }

  /* Formularios inline en móvil */
  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .form-inline .form-group {
    width: 100%;
    margin-bottom: 15px;
  }

  .form-inline .form-group:last-child {
    margin-bottom: 0;
  }

  /* Botones en móvil */
  .btn {
    width: 100%;
    margin-bottom: 10px;
  }

  .btn:last-child {
    margin-bottom: 0;
  }

  /* Tablas en móvil - usar scroll horizontal mejorado */
  .table-responsive {
    border: none;
    -webkit-overflow-scrolling: touch;
  }

  /* Alternativa: convertir a cards usando DataTables responsive */
  .dataTables_wrapper .dataTables_scrollBody {
    border: none !important;
  }

  /* Mejorar el scroll horizontal en móvil */
  .dataTables_wrapper {
    position: relative;
  }

  .dataTables_wrapper::before {
    content: '← Desliza para ver más →';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #666;
    white-space: nowrap;
  }

  /* Ocultar algunos elementos de DataTables en móvil */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_info {
    font-size: 12px;
  }

  /* Ajustar paginación en móvil */
  .dataTables_wrapper .dataTables_paginate {
    margin-top: 15px;
  }

  .dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 8px;
    font-size: 12px;
    margin: 0 2px;
  }

  /* Input groups en móvil */
  .input-group {
    flex-direction: column;
  }

  .input-group-addon {
    border-radius: 8px 8px 0 0;
    border-bottom: none;
  }

  .input-group .form-control {
    border-radius: 0 0 8px 8px;
    border-top: none;
    border-left: 1px solid #ddd;
  }

  /* Menú lateral mejorado en móvil */
  .menubar {
    width: 280px;
  }

  .app-menu li a {
    padding: 15px 20px;
    font-size: 15px;
  }

  /* Tarjetas rápidas en móvil */
  .quick-actions .col-xs-6 {
    padding: 10px;
  }

  .quick-card {
    height: 100px;
    padding: 15px;
  }

  .quick-card i {
    font-size: 32px;
    margin-bottom: 10px;
  }

  .quick-card span {
    font-size: 13px;
  }

  /* DataTables responsive */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
  }

  .dataTables_wrapper .dataTables_length select,
  .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    margin-top: 5px;
  }

  /* Ajustes de espaciado */
  .app-content {
    padding-top: 70px;
  }

  /* Mejoras para el navbar en móvil */
  .navbar-header {
    width: 100%;
  }

  .page-title {
    display: none;
  }
}

/* ========== MEJORAS PARA TABLET ========== */
@media (min-width: 768px) and (max-width: 991px) {
  .form-inline .form-group {
    min-width: 200px;
  }

  .widget-body {
    padding: 20px;
  }

  .table {
    font-size: 13px;
  }

  .table thead th,
  .table tbody td {
    padding: 10px 12px;
  }
}

/* ========== MEJORAS PARA PANTALLAS GRANDES ========== */
@media (min-width: 1200px) {
  .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
  }

  .widget-body {
    padding: 30px;
  }
}

/* ========== MEJORAS PARA SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ========== MEJORAS PARA FOCUS VISIBLE ========== */
*:focus-visible {
  outline: 2px solid #043362;
  outline-offset: 2px;
}

/* ========== MEJORAS PARA LOADING STATES ========== */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #043362;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========== MEJORAS PARA SELECT2 (si se usa) ========== */
.select2-container--default .select2-selection--single {
  border-radius: 8px;
  border: 1px solid #ddd;
  height: auto;
  padding: 8px 12px;
}

.select2-container--default .select2-selection--single:focus {
  border-color: #043362;
}

/* ========== MEJORAS PARA DATEPICKER ========== */
.datepicker {
  border-radius: 8px;
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover {
  background-color: #043362;
  border-color: #043362;
}

/* ========== MEJORAS PARA CHECKBOXES Y RADIOS ========== */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ========== MEJORAS PARA TEXTAREA ========== */
textarea.form-control {
  min-height: 100px;
  resize: vertical;
  border-radius: 8px;
}

/* ========== MEJORAS PARA FOOTER ========== */
.app-footer {
  padding: 20px;
  background-color: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  margin-top: 30px;
}

/* ========== UTILIDADES ========== */
.text-muted {
  color: #6c757d !important;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.shadow {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12) !important;
}

.shadow-lg {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* ========== MEJORAS PARA ACCESIBILIDAD ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}