/* === VARIABLES MEJORADAS === */
:root {
  --verde-lucy: #2e7d32;
  --verde-oscuro: #1b5e20;
  --verde-claro: #4caf50;
  --rojo-acento: #c62828;
  --naranja-acento: #ff6f00;
  --gris-claro: #f8f9fa;
  --gris-medio: #e9ecef;
  --gris-borde: #dee2e6;
  --texto-oscuro: #2d3748;
  --texto-muted: #718096;
  --sombra-suave: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --sombra-media: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --sombra-fuerte: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* === TIPOGRAFÍA === */
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--texto-oscuro);
}

/* === TOP BAR === */
.brand-topbar {
  background: linear-gradient(135deg, var(--verde-oscuro), var(--verde-lucy));
  color: white;
  font-size: 0.875rem;
}

.brand-announcement {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.brand-contact-info {
  color: rgba(255, 255, 255, 0.9);
}

/* === NAVBAR MEJORADA === */
.brand-navbar {
  background: linear-gradient(135deg, var(--verde-lucy), var(--verde-claro));
  backdrop-filter: blur(10px);
  box-shadow: var(--sombra-media);
}

.brand-logo-wrapper {
  position: relative;
  padding: 0.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--sombra-suave);
}

.brand-logo {
  height: 35px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  position: relative;
  z-index: 2;
  transition: height 0.3s ease;
}

.brand-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, var(--verde-lucy), var(--verde-claro));
  border-radius: 10px;
  opacity: 0.1;
  z-index: 1;
}

.brand-text {
  color: white;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  transition: font-size 0.3s ease;
}

.brand-accent {
  color: #ffd54f;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 300;
  transition: font-size 0.3s ease;
}

/* === ENLACES DE NAVEGACIÓN MEJORADOS (OPTIMIZADO PARA COMPACTAR) === */
.nav-link-enhanced {
  display: flex;
  align-items: center;
  gap: 0.25rem; /* Reducido */
  padding: 0.5rem 0.6rem !important; /* Padding reducido */
  border-radius: 8px; /* Reducido */
  color: white !important;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-size: 0.8rem;
}

.nav-link-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.nav-link-enhanced:hover::before {
  left: 100%;
}

.nav-link-enhanced:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-icon {
  width: 28px; /* Icono más pequeño */
  height: 28px; /* Icono más pequeño */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px; /* Borde más pequeño */
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.nav-link-enhanced:hover .nav-icon {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.nav-text {
  font-size: 0.75rem; /* Texto compacto */
  transition: font-size 0.3s ease;
}

/* === PERFIL DE USUARIO === */
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--verde-lucy);
  font-size: 1.25rem;
}

.user-info {
  color: white;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.user-role {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* === BOTONES MEJORADOS === */
.btn-login, .btn-logout {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-size: 0.875rem;
}

.btn-login:hover, .btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  color: white;
}

/* === CONTENIDO PRINCIPAL === */
.main-content {
  min-height: calc(100vh - 200px);
  padding: 1rem 0; /* Padding responsivo en el layout */
}

/* === FOOTER MEJORADO === */
.brand-footer {
  background: linear-gradient(135deg, var(--texto-oscuro), #2d3748);
  color: white;
  padding: 2rem 0 1rem;
  margin-top: 3rem;
}

.brand-logo-wrapper-sm {
  width: 60px;
  height: 60px;
  padding: 0.5rem;
  background: white;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-wrapper-sm img {
  height: 35px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--gris-medio);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: white;
  transform: translateX(5px);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  color: var(--gris-medio);
  font-size: 0.875rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.footer-title {
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* === TOGGLER PERSONALIZADO === */
.brand-toggler {
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  padding: 0.5rem;
  border-radius: 8px;
}

.brand-toggler .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* === RESPONSIVIDAD MEJORADA === */

/* Tamaños de fuente responsivos */
.small-responsive {
  font-size: 0.75rem;
}

/* Logo responsivo */
.brand-logo-sm {
  height: 35px;
  width: auto;
}

/* Mejoras para tablas en móviles */
.table-responsive-custom {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.table-responsive-custom .table {
  margin-bottom: 0;
}

/* Cards responsivas */
.card-mobile .card-body {
  padding: 1rem;
}

/* Botones responsivos */
.btn-mobile {
  margin-bottom: 0.5rem;
  width: 100%;
}

.btn-group-mobile {
  flex-direction: column;
}

/* Formularios responsivos */
.form-control-mobile {
  min-height: 45px;
  font-size: 16px; /* Previene zoom en iOS */
}

/* Utilidades de responsividad */
.d-none-mobile {
  display: none !important;
}

.d-block-mobile {
  display: block !important;
}

/* Texto truncado responsivo */
.text-truncate-mobile {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Espaciado responsivo */
.px-mobile-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Iconos responsivos */
.icon-sm-mobile {
  font-size: 1rem;
}

/* === MEDIA QUERIES PARA RESPONSIVIDAD === */

/* Tablets (576px - 768px) */
@media (min-width: 576px) {
  .brand-logo {
    height: 40px;
  }

  .brand-title {
    font-size: 1.5rem;
  }

  .nav-link-enhanced {
    padding: 0.75rem 1rem !important;
    font-size: 1rem;
  }

  .nav-text {
    font-size: 1rem;
  }

  .btn-login, .btn-logout {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .small-responsive {
    font-size: 0.875rem;
  }

  .brand-logo-sm {
    height: 40px;
  }

  .btn-group-mobile {
    flex-direction: row;
  }

  .btn-mobile {
    margin-bottom: 0;
    width: auto;
  }

  .icon-sm-mobile {
    font-size: 1.25rem;
  }

  .px-mobile-2 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Laptops (768px - 992px) */
@media (min-width: 768px) {
  .brand-logo {
    height: 45px;
  }

  .brand-title {
    font-size: 1.75rem;
  }

  .brand-subtitle {
    font-size: 0.875rem;
  }

  .main-content {
    padding: 2rem 0;
  }

  .brand-footer {
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
  }

  .card-mobile .card-body {
    padding: 1.25rem;
  }

  .d-none-mobile {
    display: block !important;
  }

  .d-block-mobile {
    display: none !important;
  }

  .text-truncate-mobile {
    white-space: normal;
  }

  .table-responsive-custom {
    font-size: 1rem;
  }
}

/* Escritorio (992px - 1199px) */
@media (min-width: 992px) {
  .brand-logo {
    height: 50px;
  }

  .brand-title {
    font-size: 1.75rem;
  }

  .user-profile-card {
    padding: 0.75rem 1rem;
  }

  .nav-link-enhanced .nav-icon {
    font-size: 1.1rem;
  }

  /* Ajuste de enlaces en desktop */
  .nav-link-enhanced {
    padding: 0.5rem 0.8rem !important;
  }
}

/* Escritorio Extra Grande (>= 1200px) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px; /* Ancho máximo para el contenido principal */
  }

  .brand-navbar .container {
    max-width: 1320px; /* Permitir que la barra de navegación sea ligeramente más ancha */
  }

  .brand-title {
    font-size: 2rem;
  }

  .nav-link-enhanced {
    padding: 0.5rem 0.9rem !important; /* Más padding para mejor look en XL */
    font-size: 0.9rem;
  }

  .nav-text {
    font-size: 0.9rem;
  }
}

/* Móviles (< 576px) */
@media (max-width: 575.98px) {
  .navbar-collapse {
    background: linear-gradient(135deg, var(--verde-lucy), var(--verde-claro));
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: var(--sombra-fuerte);
  }

  .user-profile-card {
    justify-content: center;
    text-align: center;
    margin: 1rem 0;
  }

  .nav-item {
    width: 100%;
  }

  .btn-login, .btn-logout {
    width: 100%;
  }

  .footer-links a,
  .footer-contact .contact-item {
    margin-bottom: 0.5rem;
    display: block;
  }

  .table-responsive-custom {
    font-size: 0.8rem;
  }

  .btn-sm-mobile {
    padding: 0.25rem 0.5rem;
    font-size: 0.775rem;
  }
}

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

.main-content > * {
  animation: fadeInUp 0.6s ease-out;
}

/* === ESTILOS ADICIONALES PARA EL DISEÑO DE LA APLICACIÓN === */
.brand-icon-wrapper {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--verde-lucy), #4caf50);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
}

.empty-state-icon {
  font-size: 4rem;
  color: #e0e0e0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.table > :not(caption) > * > * {
  padding: 0.85rem 0.5rem;
}

.table tbody tr {
  border-bottom: 1px solid var(--gris-borde);
}

.table tbody tr:last-child {
  border-bottom: none;
}

.table-hover tbody tr:hover {
  background-color: #f8fdf0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
}

.btn-group-sm > .btn {
  padding: 0.35rem 0.65rem;
}

.page-item.active .page-link {
  background-color: var(--verde-lucy);
  border-color: var(--verde-lucy);
}

.page-link {
  color: var(--verde-lucy);
}

.page-link:hover {
  color: var(--verde-oscuro);
}

.card {
  border-radius: 12px;
  overflow: hidden;
}

.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--gris-borde);
}

.form-control:focus, .form-select:focus {
  border-color: var(--verde-lucy);
  box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.15);
}

.alert {
  border-radius: 10px;
}

/* === MEJORAS ESPECÍFICAS PARA FORMULARIOS EN MÓVILES === */
@media (max-width: 768px) {
  .form-control, .form-select {
    font-size: 16px; /* Previene zoom automático en iOS */
  }

  .btn {
    padding: 0.75rem 1rem; /* Área de toque más grande */
  }

  .card {
    margin-bottom: 1rem;
  }

  .table th, .table td {
    padding: 0.5rem 0.25rem;
  }
}

/* === MEJORAS DE ACCESIBILIDAD === */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible para mejor accesibilidad */
.nav-link-enhanced:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--verde-lucy);
  outline-offset: 2px;
}

/* Alto contraste para usuarios que lo requieran */
@media (prefers-contrast: more) {
  :root {
    --verde-lucy: #006400;
    --verde-oscuro: #004400;
    --texto-oscuro: #000000;
  }

  .brand-navbar {
    background: var(--verde-oscuro);
  }
}

.admin-bg {
  background: linear-gradient(180deg, rgba(46,125,50,.06), transparent 40%);
}

/* Shell con sidebar */
.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 140px); /* ajusta si tu topbar/navbar ocupan más */
  gap: 16px;
}

.admin-shell .main {
  padding: 0.25rem 0 1.25rem;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 92px; /* ajusta si tu navbar es más alto */
  height: calc(100vh - 92px);
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(27,94,32,.12), rgba(255,255,255,.60));
  border: 1px solid var(--gris-borde);
  box-shadow: var(--sombra-media);
  overflow: auto;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem .9rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--gris-borde);
  box-shadow: var(--sombra-suave);
}

.sidebar .brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--verde-lucy);
  box-shadow: 0 0 0 6px rgba(46,125,50,.12);
}

.sidebar .navbox {
  margin-top: .85rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.sidebar .navbox a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .75rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--texto-oscuro);
  font-weight: 600;
  transition: all .2s ease;
  border: 1px solid transparent;
}

.sidebar .navbox a:hover {
  background: rgba(255,255,255,0.85);
  transform: translateY(-1px);
  box-shadow: var(--sombra-suave);
}

.sidebar .navbox a.active {
  background: rgba(46,125,50,.12);
  border-color: rgba(46,125,50,.25);
}

.sidebar .sidebar-tip {
  margin-top: .85rem;
  padding: .75rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.75);
  border: 1px dashed rgba(46,125,50,.28);
  color: var(--texto-muted);
  font-size: .9rem;
}

/* Hero header (titulo + acciones) */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(27,94,32,.20), rgba(255,255,255,.80));
  border: 1px solid rgba(46,125,50,.20);
  box-shadow: var(--sombra-media);
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.hero .subtitle {
  color: var(--texto-muted);
  font-size: .95rem;
}

/* Cards custom (para no pelear con .card de Bootstrap) */
.cardx {
  background: white;
  border: 1px solid var(--gris-borde);
  border-radius: 16px;
  box-shadow: var(--sombra-suave);
  overflow: hidden;
}

.cardx .cardx-body {
  padding: 1rem 1.05rem;
}

/* KPI grid */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-title {
  color: var(--texto-muted);
  font-size: .85rem;
  font-weight: 600;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 2px;
}

.kpi-sub {
  margin-top: 6px;
  color: var(--texto-muted);
  font-size: .92rem;
}

/* Badges “bonitos” (status) */
.badgex {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--gris-borde);
  background: rgba(45,55,72,.03);
  font-weight: 700;
  font-size: .8rem;
}

.badgex .pill {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

/* Colores de estado */
.badgex.is-success { border-color: rgba(46,125,50,.25); background: rgba(46,125,50,.08); }
.badgex.is-success .pill { background: var(--verde-lucy); }

.badgex.is-warning { border-color: rgba(255,111,0,.25); background: rgba(255,111,0,.10); }
.badgex.is-warning .pill { background: var(--naranja-acento); }

.badgex.is-danger { border-color: rgba(198,40,40,.25); background: rgba(198,40,40,.10); }
.badgex.is-danger .pill { background: var(--rojo-acento); }

.badgex.is-info { border-color: rgba(46,125,50,.20); background: rgba(76,175,80,.10); }
.badgex.is-info .pill { background: var(--verde-claro); }

/* Tabla en admin: un poco más “premium” */
.admin-table {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--gris-borde);
}

.admin-table .table {
  margin-bottom: 0;
}

.admin-table thead th {
  font-size: .85rem;
  letter-spacing: .02em;
  color: var(--texto-muted);
  background: rgba(248,249,250,1);
}

.admin-table tbody tr:hover {
  background-color: rgba(76,175,80,0.07);
  box-shadow: 0 2px 10px rgba(46,125,50,0.10);
}

/* Mini gráfico de barras (si lo usas) */
.bars7d .bar-row{
  display: grid;
  grid-template-columns: 60px 1fr 120px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.bars7d .bar-label{
  color: var(--texto-muted);
  font-variant-numeric: tabular-nums;
}
.bars7d .bar-track{
  height: 10px;
  border-radius: 999px;
  background: rgba(45,55,72,.08);
  overflow: hidden;
}
.bars7d .bar-fill{
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--verde-lucy), var(--verde-claro));
}
.bars7d .bar-value{
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--texto-oscuro);
}

/* Botones dentro de hero en mobile */
.hero .btn {
  border-radius: 12px;
}

/* Responsivo admin */
@media (max-width: 1100px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero .btn {
    width: 100%;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
}
/* === ESTILOS ESPECÍFICOS PARA EL LOGIN (Integrado con Verde Lucy) === */

/* Contenedor principal para centrar el formulario y aplicar el fondo */
.brand-login-background-wrapper {
  /* Ocupa toda la altura de la vista (necesario para centrar) */
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 50px;
  padding-bottom: 50px;
  margin-top: -50px; /* Neutraliza el margen superior del main-content */

  /* Fondo que usa los colores de la marca para sutileza */
  background-color: var(--gris-claro);
  background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23e0e0e0' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zm1 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
}

/* La tarjeta central del formulario */
.brand-login-card-attractive {
  /* Sombra profunda y agradable */
  box-shadow: var(--sombra-fuerte) !important;
  transition: transform 0.3s ease-in-out;
  background-color: white; /* Asegura fondo blanco */

  /* Borde superior de acento (naranja) */
  border-top: 5px solid var(--naranja-acento) !important;
  border-radius: 14px !important; /* Coherente con otros cards */
}

.brand-login-card-attractive:hover {
  /* Pequeño levantamiento para hacerlo más interactivo */
  transform: translateY(-2px);
}

/* Título principal del formulario */
.brand-login-card-attractive h3 {
  color: var(--verde-lucy) !important;
}

/* Estilos para el logo/iconografía */
.tiny-text {
  font-size: 0.75rem !important;
}

.brand-logo-wrapper-sm {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  /* Anillo sutil del color de la marca (verde) */
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.2);
}

.brand-logo-sm {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Inputs con íconos */
.input-group-text {
  color: var(--verde-lucy);
  background-color: var(--gris-medio) !important;
  border-right: none !important;
  border-color: var(--gris-borde) !important;
  font-size: 0.9rem;
}
.form-control {
  border-left: none;
}

/* Botón de acceso */
.btn-login-att {
  /* Usa el color principal: VERDE LUCY */
  background-color: var(--verde-lucy);
  color: white;
  border: none;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border-radius: 10px; /* Consistente con otros botones */
}

.btn-login-att:hover {
  /* Cambio de color al naranja de acento al hacer hover */
  background-color: var(--naranja-acento);
  transform: scale(1.01);
  /* Sombra usando el acento */
  box-shadow: 0 4px 10px rgba(255, 111, 0, 0.4);
}

/* ============================================
   ESTILOS ESPECÍFICOS PARA CLIENTES
   ============================================ */

/* Header mejorado para clientes */
.cliente-header {
  background: linear-gradient(135deg, var(--verde-lucy), var(--verde-claro));
  color: white;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-radius: 0.75rem;
  box-shadow: var(--sombra-media);
}

.cliente-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.cliente-header h1 {
  font-weight: 700;
  font-size: 1.75rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cliente-header .header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Tarjeta de filtros mejorada */
.filter-card {
  border: none;
  border-radius: 0.75rem;
  background: white;
  box-shadow: var(--sombra-suave);
  margin-bottom: 1.5rem;
  padding: 1.25rem;
}

.filter-card .row {
  align-items: flex-end;
}

.filter-card .form-control,
.filter-card .form-select {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.filter-card .form-control:focus,
.filter-card .form-select:focus {
  border-color: var(--verde-lucy);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.filter-checkbox {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0.375rem 0;
}

.filter-checkbox .form-check-input {
  width: 1.2em;
  height: 1.2em;
  margin-top: 0;
}

.filter-checkbox .form-check-input:checked {
  background-color: var(--verde-lucy);
  border-color: var(--verde-lucy);
}

/* Tabla mejorada */
.clientes-table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--sombra-suave);
}

.clientes-table thead {
  background: linear-gradient(135deg, var(--verde-lucy), var(--verde-oscuro));
  color: white;
}

.clientes-table thead th {
  border: none;
  padding: 1rem 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.clientes-table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
}

.clientes-table tbody tr:hover {
  background-color: #f8fdf0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
}

.clientes-table tbody td {
  padding: 1rem 0.75rem;
  vertical-align: middle;
  border: none;
}

/* Estilos para códigos en tabla */
.cliente-codigo {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--verde-lucy);
  background: #f1f8e9;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #e8f5e9;
  display: inline-block;
  min-width: 70px;
  text-align: center;
}

/* Badges personalizados */
.badge-cliente-status {
  padding: 0.35rem 0.75rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
  min-width: 80px;
  display: inline-block;
  text-align: center;
}

.badge-active {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
}

.badge-inactive {
  background: linear-gradient(135deg, #f44336, #c62828);
  color: white;
}

.badge-visited {
  background: linear-gradient(135deg, #2196f3, #1565c0);
  color: white;
}

.badge-not-visited {
  background: linear-gradient(135deg, #9e9e9e, #616161);
  color: white;
}

/* Badge para ruta */
.badge-ruta {
  background: var(--gris-medio);
  color: var(--texto-oscuro);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Acciones en tabla */
.acciones-cliente {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-end;
}

.btn-accion {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.btn-accion:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-view {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.btn-edit {
  background: #e8f5e9;
  color: var(--verde-lucy);
  border: 1px solid #c8e6c9;
}

.btn-delete {
  background: #ffebee;
  color: #d32f2f;
  border: 1px solid #ffcdd2;
}

/* Paginación mejorada */
.pagination-cliente {
  margin-top: 1.5rem;
}

.pagination-cliente .page-link {
  color: var(--verde-lucy);
  border: 1px solid var(--gris-borde);
  border-radius: 0.5rem;
  margin: 0 0.25rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
}

.pagination-cliente .page-link:hover {
  background-color: var(--verde-lucy);
  color: white;
  border-color: var(--verde-lucy);
}

.pagination-cliente .page-item.active .page-link {
  background: linear-gradient(135deg, var(--verde-lucy), var(--verde-claro));
  border-color: var(--verde-lucy);
  color: white;
}

.pagination-cliente .page-item.disabled .page-link {
  color: var(--texto-muted);
  background-color: var(--gris-claro);
  border-color: var(--gris-borde);
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: var(--sombra-suave);
}

.empty-state-icon {
  font-size: 4rem;
  color: #e0e0e0;
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--texto-muted);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--texto-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* Contador de registros */
.registros-count {
  background: #f8f9fa;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--texto-muted);
  border: 1px solid var(--gris-borde);
}

.registros-count strong {
  color: var(--verde-lucy);
}

/* Responsive */
@media (max-width: 768px) {
  .cliente-header {
    padding: 1rem;
  }

  .cliente-header h1 {
    font-size: 1.5rem;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .filter-card .row > div {
    margin-bottom: 1rem;
  }

  .clientes-table {
    font-size: 0.875rem;
  }

  .clientes-table th,
  .clientes-table td {
    padding: 0.5rem;
  }

  .acciones-cliente {
    flex-direction: column;
    gap: 0.25rem;
  }

  .btn-accion {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }
}

/* ============================================
   ESTILOS PARA FILTROS MEJORADOS
   ============================================ */

/* Contenedor de filtros con mejor espaciado */
.filter-card .row {
  margin-bottom: -0.5rem;
}

.filter-card .col-lg-3,
.filter-card .col-lg-2,
.filter-card .col-md-6 {
  margin-bottom: 1rem;
}

/* Input groups mejorados */
.filter-card .input-group {
  transition: all 0.2s ease;
}

.filter-card .input-group:focus-within {
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
  border-radius: 0.5rem;
}

.filter-card .input-group-text {
  background-color: #f8f9fa;
  border-right: none;
  color: var(--texto-muted);
}

.filter-card .input-group .form-control {
  border-left: none;
}

/* Select de rutas mejorado */
.filter-card .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%232e7d32' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  cursor: pointer;
}

.filter-card .form-select option {
  padding: 0.5rem;
}

/* Checkbox alineado verticalmente */
.filter-checkbox {
  min-height: 56px;
  padding-bottom: 0.5rem;
}

.filter-checkbox .form-check-input {
  margin-top: 0.2rem;
}

/* Botones de acción en filtros */
.filter-card .btn-primary {
  padding: 0.5rem 1rem;
  font-weight: 500;
}

.filter-card .btn-outline-secondary {
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive para filtros */
@media (max-width: 992px) {
  .filter-card .row > div {
    margin-bottom: 0.75rem;
  }

  .filter-checkbox {
    min-height: auto;
    padding-bottom: 0;
  }
}

@media (max-width: 768px) {
  .filter-card .row > div {
    width: 100% !important;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .filter-card .d-flex.gap-2 {
    justify-content: space-between;
  }

  .filter-card .btn {
    flex: 1;
  }
}

/* Placeholder mejorado para selects */
.form-select option[value=""] {
  color: var(--texto-muted);
  font-style: italic;
}

/* Efecto hover para selects */
.form-select:hover {
  border-color: var(--verde-claro);
}

/* Indicador de campo requerido */
.form-label.required::after {
  content: " *";
  color: #dc3545;
}

/* Mejora visual para selects con muchos items */
.form-select {
  max-height: 200px;
}

/* Scroll personalizado para selects */
.form-select::-webkit-scrollbar {
  width: 8px;
}

.form-select::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.form-select::-webkit-scrollbar-thumb {
  background: var(--verde-lucy);
  border-radius: 4px;
}

.form-select::-webkit-scrollbar-thumb:hover {
  background: var(--verde-oscuro);
}

/* =========================================
   MENÚ OFFCANVAS PREMIUM (usa variables Lucy)
   ========================================= */

.brand-menu-btn{
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  border-radius: 12px;
  padding: .45rem .75rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  transition: all .2s ease;
}
.brand-menu-btn:hover{
  background: rgba(255,255,255,0.26);
  transform: translateY(-1px);
  color: #fff;
}
.brand-menu-btn:focus{
  outline: 2px solid rgba(255,255,255,.55);
  outline-offset: 2px;
}

.brand-offcanvas{
  width: min(420px, 92vw);
  border: none;
  box-shadow: var(--sombra-fuerte);
}

.brand-offcanvas-header{
  background: linear-gradient(135deg, var(--verde-oscuro), var(--verde-lucy));
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.brand-offcanvas-icon{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
  font-size: 1.15rem;
}

.brand-offcanvas-subtitle{
  margin-top: .25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.brand-pill{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .78rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.18);
}
.brand-pill-role{
  background: rgba(255, 213, 79, 0.18);
  border-color: rgba(255, 213, 79, 0.25);
}

.brand-offcanvas-body{
  background:
          radial-gradient(800px 400px at -20% -20%, rgba(46,125,50,.14), transparent 60%),
          radial-gradient(800px 400px at 120% 10%, rgba(255,111,0,.10), transparent 55%),
          linear-gradient(180deg, rgba(248,249,250,1), rgba(248,249,250,.85));
}

.brand-search{
  position: relative;
}
.brand-search > i{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texto-muted);
  font-size: 1rem;
  pointer-events: none;
}
.brand-search-input{
  padding-left: 2.2rem !important;
  border-radius: 14px !important;
  border: 1px solid var(--gris-borde) !important;
  background: rgba(255,255,255,0.9) !important;
  box-shadow: var(--sombra-suave);
}
.brand-search-input:focus{
  border-color: rgba(46,125,50,.45) !important;
  box-shadow: 0 0 0 .2rem rgba(46,125,50,.12) !important;
}

.brand-menu-sections{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-menu-section{
  animation: fadeInUp .35s ease-out;
}

.brand-menu-title{
  display: flex;
  align-items: center;
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--texto-muted);
  text-transform: uppercase;
  margin: .2rem .1rem .55rem;
}

.brand-menu-card{
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--gris-borde);
  border-radius: 16px;
  box-shadow: var(--sombra-suave);
  overflow: hidden;
}

.brand-menu-item{
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto;
  gap: 0 10px;
  padding: .75rem .85rem;
  text-decoration: none;
  color: var(--texto-oscuro);
  border-bottom: 1px solid rgba(222,226,230,.7);
  transition: all .18s ease;
  position: relative;
}
.brand-menu-item:last-child{
  border-bottom: none;
}

.brand-menu-item-icon{
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(46,125,50,.10);
  color: var(--verde-lucy);
  border: 1px solid rgba(46,125,50,.18);
  box-shadow: 0 6px 14px rgba(46,125,50,.10);
  font-size: 1.05rem;
}

.brand-menu-item-text{
  font-weight: 900;
  letter-spacing: -0.2px;
  line-height: 1.1;
  margin-top: 2px;
}

.brand-menu-item-hint{
  grid-column: 2;
  font-size: .82rem;
  color: var(--texto-muted);
  margin-top: -2px;
}

.brand-menu-item:hover{
  background: rgba(76,175,80,0.08);
  transform: translateY(-1px);
}
.brand-menu-item:hover .brand-menu-item-icon{
  background: rgba(255,111,0,.10);
  border-color: rgba(255,111,0,.22);
  color: var(--naranja-acento);
}

.brand-menu-item.active{
  background: rgba(46,125,50,.10);
  border-left: 5px solid rgba(46,125,50,.55);
}
.brand-menu-item.active .brand-menu-item-icon{
  background: rgba(46,125,50,.16);
  border-color: rgba(46,125,50,.28);
  color: var(--verde-oscuro);
}

.brand-menu-empty{
  padding: .85rem .9rem;
  color: var(--texto-muted);
  font-weight: 600;
  font-size: .92rem;
  background: rgba(45,55,72,0.03);
}

.brand-menu-tip{
  padding: .8rem .85rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.75);
  border: 1px dashed rgba(46,125,50,.25);
  color: var(--texto-muted);
  box-shadow: var(--sombra-suave);
}

/* Mobile tweaks */
@media (max-width: 575.98px){
  .brand-offcanvas{
    width: 92vw;
  }
  .brand-menu-btn span{
    display:none !important;
  }
}
