/* ================================ TUS VARIABLES GLOBALES ================================= */
:root {
  /* Colores principales (ADAPTADOS A #517257) */
  --primary-color: #043034;
  --secondary-color: #d8ae5e;
  --accent-color: #2d3d31;
  --dark-blue: #394c40;

  /* Colores neutrales */
  --white: #ffffff;
  --light-gray: #f5f6f7;
  --medium-gray: #e5e7eb;
  --dark-gray: #6c757d;
  --text-color: #333333;

  /* Tipografía */
  --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  /* Espaciado */
  --section-padding: 80px 0;
  --container-width: 1200px;

  /* Sombras */
  --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.1);

  /* Bordes */
  --border-radius: 10px;
  --border-radius-sm: 5px;

  /* Responsive */
  --sidebar-width: 260px;
  --gap: 24px;
  --container-max: 1440px;
  --breakpoint: 980px;
}

/* ================================ RESET Y ESTILOS BASE ================================= */
html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  color: var(--text-color);
  background-color: var(--light-gray);
}

/* Preloader Global Premium (Ahora solo para procesos específicos) */
#page-loader {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--white);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  max-height: 50px;
  margin-bottom: 25px;
  animation: pulse 1.5s ease-in-out infinite;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f1f5f9;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); }
}

/* ================================ ESTILOS ESPECÍFICOS PARA LOGIN ================================= */
/* ================================ ESTILOS ESPECÍFICOS PARA LOGIN PREMIUM ================================= */
.login {
  margin: 0;
  padding: 0;
  background-color: var(--white);
  overflow-x: hidden;
}

.login-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Lado del Formulario (Izquierda) */
.login-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #f8fafc; /* Fondo sutil para resaltar la tarjeta */
  z-index: 2;
  position: relative;
}

.login-container {
  width: 100%;
  max-width: 500px; /* Aumentado de 450px a 500px */
  background: var(--white);
  padding: 50px 40px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.02);
  text-align: center;
  animation: slideInLeft 0.8s ease-out;
}

.logo-login {
  max-height: 80px;
  margin-bottom: 20px;
}

.logo-title {
  font-size: 2.2rem;
  color: var(--primary-color);
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--dark-gray);
  margin-bottom: 40px;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Lado de la Imagen (Derecha) */
.login-image-side {
  flex: 1.2;
  background: url('/assets/img/login_bg.png') no-repeat center center;
  background-size: cover;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 60px;
}

.login-image-side::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(4, 48, 52, 0.4) 0%, rgba(4, 48, 52, 0.8) 100%);
}

.image-overlay-text {
  position: relative;
  color: var(--white);
  z-index: 1;
  max-width: 500px;
  animation: fadeIn 1.2s ease-in;
}

.image-overlay-text h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.1;
}

.image-overlay-text p {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Formulario */
.form-group {
  margin-bottom: 24px;
  position: relative;
  padding-left: 45px; /* Espacio reservado para el icono fuera del input */
}

.form-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-top: 10px;
  margin-bottom: 8px;
  font-weight: 800;
  display: block;
  text-align: left;
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: -35px; /* Posicionado fuera a la izquierda */
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  transition: color 0.3s;
  font-size: 1.1rem;
}

.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
  padding: 14px 16px; /* Padding normal ya que el icono está fuera */
  background: #f8fafc;
  border: 2px solid #f1f5f9;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s;
  width: 100%;
}

.login input:focus {
  background: var(--white);
  border-color: var(--secondary-color); /* BORDE DORADO RESTAURADO */
  box-shadow: 0 0 0 4px rgba(216, 174, 94, 0.15);
  outline: none;
}

.login input:focus + i {
  color: var(--secondary-color);
}

.btn-login {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 16px;
  width: 100%;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-top: 10px;
  box-shadow: 0 10px 20px rgba(4, 48, 52, 0.15);
}

.btn-login:hover {
  background: #064045;
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(4, 48, 52, 0.2);
}

.btn-login.is-loading {
  pointer-events: none;
  opacity: 0.8;
  background: var(--accent-color);
}

.btn-login.is-loading span {
  display: none;
}

.btn-login.is-loading::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid var(--white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

.footer-text {
  margin-top: 40px;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

/* Animaciones */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
  .login-image-side {
    display: none;
  }
  .login-side {
    padding: 30px;
  }
}

/* ================================ ESTILOS ESPECÍFICOS NAVBAR ================================= */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  border-bottom: 1px solid var(--medium-gray);
  width: 100%;
}

.top-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 18px;
  height: 70px;
  display: flex;
  align-items: center;
}

.brand {
  height: 7vh;
}

.right {
  margin-left: auto;
  display: flex;
  gap: 14px;
  align-items: center
}

.chip {
  padding: 8px 10px;
  border: 1px solid var(--medium-gray);
  border-radius: var(--border-radius);
  color: var(--dark-gray);
  font-size: .92rem;
  background: var(--white);
  margin-right: 10px;
}

.btn {
  background: var(--primary-color);
  color: var(--white);
  border: 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: .15s transform, .15s opacity;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: .95
}

/* ================================ ESTILOS ESPECÍFICOS EL CONTENIDO ================================= */

.sidebar-component {
  position: sticky;
  top: 82px;
  height: calc(100vh - 100px);
  background: var(--primary-color);
  border-radius: var(--border-radius);
  padding: 14px;
  overflow: auto;
}

.sidebar-component ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-component a {
  display: flex;
  text-decoration: none;
  align-items: center;
  gap: 10px;
  color: var(--white);
  padding: 12px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .06);
  transition: .15s;
  font-weight: 700;
}

.sidebar-component a:hover {
  background: rgba(255, 255, 255, .12);
  transform: translateX(2px)
}

.sidebar-component .section-title {
  color: rgba(255, 255, 255, .78);
  font-size: .85rem;
  font-weight: 900;
  margin: 10px 8px 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ================================ Resposnsive ================================= */

.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--gap);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--gap);
}

.sidebar-column {
  /* El ancho lo determina el grid de app-container */
  min-width: 0;
}

/* Link activo en el sidebar */
.sidebar-component a[style*="rgba(255,255,255,.15)"] {
  background: rgba(255,255,255,.18) !important;
  border-left: 3px solid var(--secondary-color);
}

.content-wrapper {
  /* El flujo lo maneja el grid de app-container */
  min-height: calc(100vh - 120px);
}

.grid-system {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  align-items: start;
}

.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }

/* Estilos para Tablas Generales */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  background: #fff;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--medium-gray);
}

th {
  background-color: #f8fafc;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

tr:hover td {
  background-color: #f8fafc;
}

.pill, .badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: var(--medium-gray);
  color: var(--dark-gray);
  text-transform: capitalize;
}

.card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--shadow-light);
  margin-bottom: 20px;
}

@media (max-width: 980px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .grid-system > * {
    grid-column: 1 / -1 !important;
  }
  .sidebar-component {
    position: relative;
    top: auto;
    height: auto;
  }
}

/* ================================ NOTIFICACIONES ================================= */
.notif-container {
  position: relative;
  margin-right: 20px;
  cursor: pointer;
}

.notif-bell {
  font-size: 1.4rem;
  color: var(--dark-gray);
  transition: color 0.3s;
}

.notif-bell:hover {
  color: var(--primary-color);
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 10px;
  border: 2px solid white;
}

.notif-dropdown {
  position: absolute;
  top: 45px;
  right: -10px;
  width: 350px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--medium-gray);
  display: none;
  z-index: 1000;
  overflow: hidden;
}

.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--medium-gray);
  font-weight: 700;
  color: var(--primary-color);
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  padding: 15px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  cursor: pointer;
}

.notif-item:hover {
  background: #f8fafc;
}

.notif-item.unread {
  background: #f0f9ff;
  border-left: 4px solid var(--primary-color);
}

.notif-item .nt-title {
  font-weight: 700;
  color: var(--text-color);
  font-size: 0.88rem;
}

.notif-item .nt-msg {
  font-size: 0.82rem;
  color: var(--dark-gray);
  line-height: 1.4;
}

.notif-item .nt-date {
  font-size: 0.75rem;
  color: #94a3b8;
}

.notif-empty {
  padding: 30px;
  text-align: center;
  color: #94a3b8;
  font-style: italic;
  font-size: 0.9rem;
}
/* ================================ DATATABLES & SEARCH STANDARD PREMIUM ================================= */

/* Ocultar elementos innecesarios */
.dataTables_filter, .dataTables_info {
    display: none !important;
}

/* Contenedor de búsqueda Estándar (Basado en imagen usuario) */
.standard-search-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 30px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.05); /* Sombra suave */
    margin-bottom: 30px;
}

.standard-search-title {
    display: block;
    margin-bottom: 15px;
    font-weight: 800;
    font-size: 0.8rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.standard-search-flex {
    display: flex;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.standard-search-wrapper {
    position: relative;
    flex: 1;
}

.standard-search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
}

.standard-search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: all 0.3s ease;
}

.standard-search-input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(4, 48, 52, 0.05);
}

.standard-search-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    white-space: nowrap;
}

.standard-search-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Otros filtros (Dropdowns) se pueden poner debajo o al lado */
.standard-search-filters {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

/* Paginación minimalista */
.dataTables_paginate {
    display: flex !important;
    gap: 6px !important;
    margin-top: 30px !important;
    justify-content: flex-end;
}

.dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    padding: 10px 18px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    background: #fff !important;
    color: #64748b !important;
    border: 1px solid #f1f5f9 !important;
    transition: all 0.2s;
    cursor: pointer;
}

.dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
}

.dataTables_paginate .paginate_button:hover:not(.current):not(.disabled),
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: #f8fafc !important;
    color: var(--primary-color) !important;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: default !important;
}

table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
}
