:root {
  --app-max-width: 1520px;
  --app-x-padding: 24px;
}

h1.h4, .card-header{
  color: #01143e; /* color principal del tema */
  font-weight: 700;
  letter-spacing: 0.5px;
}
/* Contenedor principal del contenido (centrado moderado) */
.app-container {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding-left: var(--app-x-padding);
  padding-right: var(--app-x-padding);
}

/* General */
body { background: #01143E; }
#content {
  padding-top: 1.25rem !important;
  padding-bottom: 1.25rem !important;
}
.alert { margin-bottom: .75rem; }

/* -------- Topbar -------- */
.topbar-modern {
  background: linear-gradient(90deg, #01143E 0%, #0b315f 60%, #164a7f 100%);
  color: #eaf1ff;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  border-bottom: none;
}
.topbar-modern .brand-title { font-weight: 700; color: #fff; letter-spacing: .2px; }
.topbar-modern .brand-subtitle { color: rgba(255,255,255,.80); letter-spacing: .2px; }
.topbar-modern .nav-link, .topbar-modern .text-user, .topbar-modern .text-caret {
  color: #eaf1ff !important;
}
.topbar-modern .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #f0f4ff; color: #01143E; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: .25rem; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.topbar-info {
  padding: .35rem .75rem; border-radius: 8px;
  background: rgba(255,255,255,.06); color: #f0f4ff;
  font-size: 0.9rem; font-weight: 500;
}
.topbar-info .badge {
  background: #f8f9fc; color: #01143E; font-weight: 600;
}

/* -------- Sidebar degradado + navegación -------- */
.bg-gradient-primary {
  background: linear-gradient(180deg, #01143E 0%, #0b2a66 40%, #164a7f 100%) !important;
  background-size: 200% 200%;
  animation: sidebarGradientShift 18s ease infinite;
}
@keyframes sidebarGradientShift {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}
.sidebar .nav-item .nav-link {
  color: rgba(255,255,255,0.85) !important;
  transition: all 0.2s ease-in-out;
}
.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link.active {
  color: #fff !important;
  background-color: rgba(255,255,255,0.08);
  border-radius: 0.35rem;
}
.sidebar hr.sidebar-divider {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin: 0.75rem 1rem;
}
.sidebar-heading {
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  padding-left: 1rem;
  letter-spacing: 0.05em;
}

#accordionSidebar { padding-top: 0 !important; }

/* Bloque del brand con aire arriba */
.sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;

  /* más alto y con padding superior real */
  min-height: 110px;
  padding: 24px 0 14px 0;  /* <-- aire arriba */
  margin: 0;
  overflow: hidden;
}

/* Contenedor interno del logo */
.sidebar .sidebar-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;

  padding: 0 !important;
  margin: 0;
}

/* Imagen del logo: un poco más grande pero sin tocar bordes */
.sidebar .sidebar-brand-icon img {
  max-height: 130px;       /* sube si lo quieres aún más grande */
  width: auto;
  display: block;
  object-fit: contain;
}

/* Separador debajo del logo */
.sidebar hr.sidebar-divider.my-0 {
  margin-top: 12px !important;
  margin-bottom: 16px !important;
}

/* Estado colapsado del sidebar (SB Admin 2) */
.sidebar.toggled .sidebar-brand {
  min-height: 4.375rem;
  padding: 0;
}
.sidebar.toggled .sidebar-brand-icon img {
  max-height: 32px;
}

/* Viewports muy bajos: evita que “apriete” */
@media (max-height: 640px) {
  .sidebar .sidebar-brand { min-height: 150px; padding-top: 16px; }
  .sidebar .sidebar-brand-icon img { max-height: 110px; }
}

/* -------- Botones y texto base -------- */
.text-primary { color: #114072 !important; }
.btn-primary {
  background-color: #114072 !important;
  border-color: #114072 !important;
}
.btn-primary:hover {
  background-color: #0b213a !important;
  border-color: #0b213a !important;
}

/* -------- Footer -------- */
footer {
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
}
footer a:hover { text-decoration: underline; }

/* -------- Login card (si aplica) -------- */
.card-login{
  max-width: 960px;
  margin: 3rem auto;
  border-radius: 1rem;
  overflow: hidden;
}
.login-image-container, .login-form-container{ background: #fff; }
.login-image-container{
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.login-image-container img{ width: 85%; height: auto; }
.form-control-user{
  font-size: 1rem; padding: 0.9rem 1.1rem; height: calc(2.8rem + 2px);
  border: 1px solid #d1d3e2; box-shadow: none;
}
.form-control-user:focus{ border-color:#b7b9cc; box-shadow: none; }
.card-login hr{ display:none; }
@media (max-width: 768px){ .login-image-container{ display: none; } }
/* ============================================================
   BASS - Estilo compacto para tablas, buscador y paginación
   ============================================================ */

/* --- Formularios compactos (buscador y filtros) --- */
.form-compact input[type="text"],
.form-compact input[type="search"],
.form-compact select,
.form-compact .form-control,
.form-compact .btn {
  font-size: 0.875rem;               /* texto de ~14px */
  padding: 0.25rem 0.5rem;           /* compacto */
  height: calc(1.5em + 0.5rem + 2px); /* iguala altura entre input, select y botón */
}

/* Ajuste visual del input-group: evita doble borde con el botón */
.input-group.input-group-sm .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* --- Tabla compacta --- */
table.table {
  font-size: 0.875rem;
}
table.table thead th {
  white-space: nowrap; /* evita saltos de línea en encabezados */
}
table.table td,
table.table th {
  padding: 0.4rem 0.5rem; /* menos espacio vertical */
  vertical-align: middle;
}

/* --- Paginación y card-footer --- */
.pagination.pagination-sm .page-link {
  padding: 0.25rem 0.5rem;
}
.card-footer.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* --- Badges y botones pequeños --- */
.badge {
  padding: 0.25em 0.5em;
  font-size: 0.75rem;
}
.btn-sm {
  padding: 0.15rem 0.35rem;
  font-size: 0.75rem;
}

/* --- Espaciado uniforme para texto pequeño --- */
.text-muted.small {
  font-size: 0.8125rem; /* 13px */
}

/* --- Ajuste responsivo suave para pantallas pequeñas --- */
@media (max-width: 768px) {
  .form-compact .col-md-3,
  .form-compact .col-md-6 {
    margin-bottom: 0.5rem;
  }
  table.table {
    font-size: 0.8rem;
  }
}

/* ---- Sidebar: espaciado equilibrado ---- */
.sidebar .nav-item .nav-link {
  padding-top: 0.45rem;     /* default es ~0.75rem */
  padding-bottom: 0.45rem;
  font-size: 0.92rem;       /* ligeramente más pequeño */
}

/* ---- Íconos ---- */
.sidebar .nav-item .nav-link i {
  margin-right: 0.4rem;
  font-size: 0.95rem;
}

/* ---- Divisores ---- */
.sidebar hr.sidebar-divider {
  margin: 0.65rem 1rem;
}

/* ---- Encabezados de sección ---- */
.sidebar .sidebar-heading {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  opacity: 0.9;
}

/* ---- Submenús desplegables ---- */
.sidebar .collapse-inner .collapse-item {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  font-size: 0.88rem;
}
.table td, .table th { vertical-align: middle; }
.table-bordered td { font-size: 0.875rem; word-break: break-word; }
.text-danger { background-color: #ffe6e6; }
.text-success { background-color: #e6ffe6; }
.modal-header { background-color: #f1f5ff; border-bottom: 1px solid #dee2e6; }
