/* ===================================
   VARIABLES GLOBALES UNIFICADAS
   =================================== */

:root {
  /* Colores base del sistema */
  --bs-body-bg: #F6F9FC;
  --bs-text-color: #1f2c73;
  --bs-link-color: #1f2c73;
  --bs-body-color: #1f2c73;
  --bs-bg-primary-color: #1f2c73;
  --bs-link-color-rgb: #1f2c73;
  --bs-card-cap-bg: #fff;
  --bs-card-border-color: transparent;
  
  /* Sombras y bordes */
  --shadow:  rgba(0, 0, 0, 0.1) 0px 4px 12px;
  --border-color: rgb(229, 234, 239);
  
  /* Sistema de colores primary verde */
  --primary-gradient: linear-gradient(135deg, #10ac84 0%, #00a085 100%);
  --primary-gradient-hover: linear-gradient(135deg, #0e9c75 0%, #008f76 100%);
  --primary-gradient-active: linear-gradient(135deg, #0c8966 0%, #007965 100%);
  --primary-color: #007965;
  --primary-color-hover: #007965;
  --primary-color-active: #0c8966;
  --primary-shadow: rgba(16, 172, 132, 0.2);
  --primary-shadow-hover: rgba(16, 172, 132, 0.3);
  --primary-shadow-focus: rgba(16, 172, 132, 0.4);
  
  /* NUEVAS: Para hovers y backgrounds */
  --primary-bg-light: rgba(16, 172, 132, 0.1);
  --primary-bg-hover: rgba(16, 172, 132, 0.1);
  --bs-table-striped-bg: rgba(16, 172, 132, 0.1);
  
  /* Gradiente sidebar */
  --sidebar-gradient: linear-gradient(180deg, #1f2c73 0%, #2a3985 100%);
  --soft-bg: #effbff;
  /* brand */
    --brand-blue: #1f2c73; /* sector a */
    --brand-blue-20: rgb(73, 85, 143); /* sector b */
    --brand-blue-30: rgb(115, 126, 171); /* sector c */

    --bs-pagination-bg: #ffffff;
    --bs-body-bg: #ffffff;
    --bs-emphasis-color: #1f2c73;
}
.content-area {
  background-color: #fafcfc;
}
.max-h-panel-1 {
    height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}
.bg-brand {
    background-color: var(--brand-blue);
    color: white;
}

.bg-brand-20 {
    background-color: var(--brand-blue-20);
    color: white;
}

.bg-brand-30 {
    background-color: var(--brand-blue-30);
    color: white;
}
.bg-brand-gradient {
   background: linear-gradient(90deg, #5fa99c 0%, #4a9b8e 50%, #007965 100%);
}

.table>:not(caption)>*>* {
  border-bottom: 1px solid var(--border-color);
}

.progress {
  border-radius: 50px;
  div {
    border-radius: 50px;
  }
}

h1, .h1 {
    font-size: clamp(1.5rem, 4vw, 1.75rem) !important;
}

h2, .h2 {
    font-size: clamp(1.25rem, 3vw, 1.5rem) !important;
}

h3, .h3 {
    font-size: clamp(1.125rem, 2.5vw, 1.25rem) !important;
}

h4, .h4 {
    font-size: clamp(1.0625rem, 2vw, 1.125rem) !important;
}

h5, .h5 {
    font-size: clamp(1rem, 1.5vw, 1.0625rem) !important;
}
.row-resume {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
    grid-template-columns: repeat(4, minmax(250px, 1fr));
    overflow-x: auto;
}

/* Tablet: 2 columnas con scroll */
@media (max-width: 991.98px) {
    .row-resume {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }
}

/* Mobile: scroll horizontal */
@media (max-width: 767.98px) {
    .row-resume {
        grid-template-columns: repeat(4, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* Scrollbar personalizado */
.row-resume::-webkit-scrollbar {
    height: 6px;
}

.row-resume::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.row-resume::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.row-resume::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
.badge-soft {
  color: var(--bs-text-color) !important;
  background-color: var(--soft-bg);
}
.sidebar-logo-large {
  width: 100%;max-width: 140px;margin-left: 30px;
}
/* ===================================
   ESTILOS BASE
   =================================== */
.text-muted {
    color: #525566 !important;
}
td .btn {
  text-wrap: nowrap;

}
body {
  background-color: var(--bs-body-bg);
  color: var(--bs-text-color);
  font-family: "Geist", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  font-weight: 350;
}

.container-fluid {
  max-width: 1800px;
}

h6, .h6, h5, .h5, h4, .h4, h3, .h3, h2, .h2, h1, .h1 {
  color: var(--bs-text-color);
  font-weight: 600;
}

/* ===================================
   COMPONENTES CARDS Y WIDGETS
   =================================== */

.kpi-widget {
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  position: relative;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: all 300ms ease-in-out;
}

.kpi-widget:hover {
  transform: translateY(-2px);
  box-shadow: rgba(145, 158, 171, 0.4) 0px 0px 4px 0px, rgba(145, 158, 171, 0.16) 0px 16px 32px -4px;
}

.kpi-widget h6 {
  margin-bottom: 0px;
  font-size: 14px;
  color: var(--bs-text-color);
}

.kpi-widget h3 {
  font-size: 28px;
  margin: 10px 0px;
  color: var(--bs-text-color);
}

.kpi-widget p {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 0px;
}

body .card.shadow {
  box-shadow: var(--shadow) !important;
  border: none !important;
  background-color: #fff;
}

body .card.shadow h3 {
  font-size: 18px;
  color: var(--bs-text-color);
}
.table>:not(caption)>*>* {
  background-color: transparent;
}
.card-header {
  background-color: transparent !important;
  border-bottom: 1px solid var(--border-color);
}
.disabled>.page-link, .page-link.disabled {
  background-color: #fff;
  opacity: 0.6; 
}

/* ===================================
   BOTONES UNIFICADOS
   =================================== */

.btn {
  border-radius: 50px;
  font-weight: 500;
  transition: all 300ms ease-in-out;
}
.btn.btn-not-rounded {
  border-radius: 8px;
}

.btn-primary {
  background: var(--primary-gradient) !important;
  border-color: transparent !important;
  color: white !important;
  box-shadow: 0 2px 4px var(--primary-shadow);
}

.btn-primary:hover {
  background: var(--primary-gradient-hover) !important;
  border-color: transparent !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--primary-shadow-hover);
}

.btn-primary:focus,
.btn-primary.focus {
  background: var(--primary-gradient) !important;
  border-color: transparent !important;
  color: white !important;
  box-shadow: 0 0 0 0.2rem var(--primary-shadow-focus);
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
  background: var(--primary-gradient-active) !important;
  border-color: transparent !important;
  color: white !important;
  transform: translateY(0);
  box-shadow: 0 2px 4px var(--primary-shadow);
}

/* ARREGLADO: Btn outline como nav-pills */
.btn-outline-primary {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-bg-hover) !important;
  border-color: var(--primary-color) !important;
  color: var(--primary-color-hover) !important;
  transform: translateY(-1px);
  box-shadow: none;
}

.btn-outline-primary:focus,
.btn-outline-primary.focus {
  background: var(--primary-bg-light) !important;
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem var(--primary-shadow-focus);
}

.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active {
  background: var(--primary-bg-light) !important;
  border-color: var(--primary-color-active) !important;
  color: var(--primary-color-active) !important;
  transform: translateY(0);
}

/* ===================================
   NAV PILLS MEJORADAS
   =================================== */

.nav-pills .nav-link {
  border-radius: 50px;
  transition: all 300ms ease-in-out;
  font-weight: 500;
  color: #525566;
  padding: 0.5rem 1.5rem;
}

.nav-pills .nav-link:hover {
  background-color: var(--primary-bg-hover);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background: var(--primary-gradient) !important;
  border-color: transparent !important;
  color: white !important;
  box-shadow: 0 2px 4px var(--primary-shadow);
}

.nav-pills .nav-link.active:hover,
.nav-pills .show > .nav-link:hover {
  background: var(--primary-gradient-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--primary-shadow-hover);
}

/* ===================================
   LOGIN
   =================================== */

.guest-content {
    background: var(--sidebar-gradient);
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    .login-container {
      max-width: 600px;
      width: 100%;
    }
}


/* ===================================
   SIDEBAR MEJORADO
   =================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background: var(--sidebar-gradient);
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(-250px);
}

.sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  min-height: 80px;
}

.sidebar-nav {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 8px 20px;
  color: #adb5bd;
  text-decoration: none;
  transition: all 300ms ease-in-out;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 50px 0px 0px 50px;
  margin-bottom: 10px;
  margin-left: 20px;
  border-right: none;
}

.sidebar-nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateX(12px);
}

.sidebar-nav-link.active {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.sidebar-nav-link > span {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-nav-link .badge {
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: center;
  border-radius: 50px;
  font-size: 0.75rem;
  min-width: 20px;
  height: 20px;
}
.content-area {
  .badge {
    font-size: 0.75rem !important;
    border: 1px dotted;
  }
  .bg-danger {
    color: #B71C1C;
    background-color: #FFCDD2 !important;
    
  }
  .bg-danger-2 {
    background-color: #B71C1C;
  }
  .bg-warning {
    color: #8C6D1F;
    background-color: #FFF9C4 !important;
  }
  .bg-warning-2 {
    background-color: #8C6D1F;
  }
  .bg-secondary {
    color: #24327B;
    background-color: #E0E0E0 !important;
  }
  .bg-secondary-2 {
    background-color: #24327B !important;
  }
  .bg-success {
    color: #008f76;
    background-color: #e6fdf8  !important;
  }
  .bg-success-2 {
    background-color: #008f76;
  }
  .table-striped-custom {
    .bg-danger, .bg-warning, .bg-secondary, .bg-success {
      min-width: 80px;
      display: inline-block;
    }
  }
  
}
.sidebar-nav-link i {
  margin-right: 0.75rem;
  width: 18px;
  text-align: center;
}

.sidebar-nav-section {
  padding: 0.5rem 1rem;
  padding-left: 40px !important;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1rem;
}

/* ===================================
   LAYOUT PRINCIPAL
   =================================== */

.main-content {
  margin-left: 250px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.main-content.expanded {
  margin-left: 0;
}

.top-bar {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-height: 80px;
}

.content-area {
  padding: clamp(1rem, 5vw, 3rem);
}

/* ===================================
   COMPONENTES DE ACCIÓN
   =================================== */

.buttons-action {
  width: 100px;
  justify-content: space-between;
  gap: 0.5rem;
}

.buttons-filter {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  width: calc(100% + 2rem);
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-left: -1rem;
  margin-right: -1rem;
  margin-top: calc(-1 * var(--bs-card-spacer-y));
  background-color: var(--bs-body-bg);
  border-radius: 6px 6px 0 0;
}

.buttons-filter label {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--bs-text-color);
}

/* ===================================
   FORM CONTROLS
   =================================== */

.form-control,
.form-select {
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: all 300ms ease-in-out;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem var(--primary-shadow-focus) !important;
}

.form-check-input:checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

/* ===================================
   UTILIDADES Y COMPONENTES ADICIONALES
   =================================== */

.user-dropdown {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.user-info:hover {
  background-color: #f8f9fa;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background-color: #6c757d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #495057;
  font-size: 1.25rem;
  cursor: pointer;
}

/* ===================================
   BADGES Y ELEMENTOS ESPECIALES
   =================================== */

.badge.bg-primary {
  background: var(--primary-gradient) !important;
  color: white !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.link-primary {
  color: var(--primary-color) !important;
  transition: all 300ms ease-in-out;
}

.link-primary:hover {
  color: var(--primary-color-hover) !important;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-250px);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .buttons-filter {
    gap: 1rem;
  }

  .buttons-action {
    width: auto;
    flex-direction: column;
  }
}

/* ===================================
   SCROLLBARS PERSONALIZADOS
   =================================== */

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ===================================
   ANIMACIONES Y TRANSICIONES
   =================================== */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.table-striped-custom>tbody>tr:nth-of-type(odd)>* {
    background-color: var(--soft-bg);
}
.table-striped-custom td {
    vertical-align: middle;
}
hr {
  border-top: 1px solid var(--border-color) !important;
  opacity: 1; 
}

.max-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.max-text:hover {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}
.active>.page-link, .page-link.active {
    z-index: 3;
    color: var(--bs-pagination-active-color);
    background-color: var(--bs-body-color) !important;
    border-color: var(--bs-body-color) !important;
}
body div.dataTables_wrapper div.dataTables_info, body div.dataTables_wrapper div.dataTables_paginate {
  padding-top: 2.5rem;
}
.text-decoration-underline {
    text-underline-offset: 4px;
}

/* Loaders */
@keyframes smoothEntry {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Solo la capa principal */
.page-load .content-area { 
    animation: smoothEntry 0.5s ease-out both; 
}

/* Loader overlay para content-area */
.content-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 40; /* Menor que el modal backdrop (1050) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* En mobile, considerar el sidebar */
@media (min-width: 992px) {
    .content-loader {
        left: 260px; /* Ancho del sidebar */
    }
}

.content-loader.show {
    opacity: 1;
    visibility: visible;
}

.loader-content {
    display: flex;
    align-items: center;
    background: white;
    padding: 32px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.loader-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(var(--bs-text-color-rgb), 0.2);
    border-top: 4px solid var(--bs-text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-left: 20px;
    color: var(--bs-text-color);
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================
   NOTIFICATION SYSTEM
   =================================== */

/* Notification Bell Button */
.notification-bell {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--bs-text-color);
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.notification-bell:hover {
    background-color: var(--primary-bg-hover);
    color: var(--primary-color);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid var(--bs-body-bg);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Notification Panel */
.notification-panel {
    width: 350px !important;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    max-height: 500px;
    overflow: hidden;
}

/* Notification Header */
.notification-header {
    padding: 1rem;
    background-color: var(--bs-card-cap-bg);
    border-bottom: 1px solid var(--border-color);
}

.notification-header h6 {
    color: var(--bs-text-color);
    font-weight: 600;
}

/* Notification Footer */
.notification-footer {
    padding: 0.75rem 1rem;
    background-color: var(--bs-card-cap-bg);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* Notification List */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Individual Notification Item */
.notification-item {
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--bs-text-color);
    transition: background-color 0.2s ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: var(--primary-bg-hover);
    color: var(--bs-text-color);
    text-decoration: none;
}

/* Notification Icon */
.notification-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--primary-color);
    background-color: var(--primary-bg-light);
}

/* Notification Content */
.notification-content {
    flex-grow: 1;
    min-width: 0;
}

.notification-content p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 500;
}

.notification-content small {
    color: var(--bs-text-muted);
    font-size: 0.8rem;
}

/* Empty State */
.notification-list .text-muted {
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .notification-panel {
        width: 320px !important;
    }
    
    .notification-item {
        padding: 0.75rem;
    }
    
    .notification-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
}

