:root{
  --brand:#5b7cff; --brand-2:#9c6bff;
  --ink:#0e1020; --ink-2:#1a1d34; --ink-3:#263058;
  --bg-grad: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 60%, var(--ink-3) 100%);
}
/* =========================================================
   LOGIN – Estilos completos
   Unifica fondo, línea central, tipografía del hero y panel derecho
   ========================================================= */

/* ---------- Variables de paleta (ajústalas acá) ---------- */
:root{
  --auth-bg-a:#0f1225;      /* azul muy oscuro */
  --auth-bg-b:#171b36;      /* azul profundo */
  --auth-bg-c:#26366a;      /* azul intermedio */
  --auth-accent:#4f7bff;    /* acento */

  --panel-bg: rgba(255,255,255,.96);
  --panel-bd: rgba(15,23,42,.10);
  --panel-shadow: 0 10px 28px rgba(0,0,0,.10);

  --panel-bg-hover: rgba(255,255,255,.985);
  --panel-bd-hover: rgba(15,23,42,.16);
  --panel-shadow-hover: 0 16px 38px rgba(0,0,0,.14);

  --hero-text-strong: rgba(255,255,255,.94);
  --hero-text:        rgba(255,255,255,.86);
  --hero-muted:       rgba(255,255,255,.65);
  --hero-link:        #d8e3ff;
}

/* Utilidad usada en el hero */
.text-white-75 { color: rgba(255,255,255,.75)!important; }

/* ---------- Fondo unificado y línea central ---------- */
body.bg-auth{
  min-height:100vh;
  position: relative;
  background:
    radial-gradient(1100px 700px at 12% 12%, rgba(255,255,255,.035), transparent 60%),
    radial-gradient(900px 900px at 78% 30%, rgba(79,123,255,.10), transparent 60%),
    linear-gradient(135deg, var(--auth-bg-a) 0%, var(--auth-bg-b) 55%, var(--auth-bg-c) 100%);
}
body.bg-auth::before{
  content:"";
  position: fixed;
  left: 50%;
  top: 8vh;
  bottom: 8vh;
  width: 1px;
  transform: translateX(-.5px);
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.28), transparent);
  pointer-events: none;
  z-index: 0;
}

/* En móviles, la línea a veces molesta */
@media (max-width: 991.98px){
  body.bg-auth::before{ display:none; }
}

/* ---------- Lados sin fondos propios (comparten el del body) ---------- */
.auth-hero,
.auth-panel{
  background: transparent !important;
}

/* ---------- Tipografía del HERO (lado izquierdo) ---------- */
.auth-hero{ color: var(--hero-text); }
.auth-hero h1,
.auth-hero .display-1,.auth-hero .display-2,.auth-hero .display-3,
.auth-hero .display-4,.auth-hero .display-5,.auth-hero .display-6{
  color: var(--hero-text-strong);
}
.auth-hero p,
.auth-hero .lead{ color: var(--hero-text); }
.auth-hero .text-muted,
.auth-hero small,.auth-hero .small{ color: var(--hero-muted) !important; }
/* Si por HTML heredaste utilidades oscuras, las forzamos a claro */
.auth-hero .text-dark,
.auth-hero .text-black{ color: var(--hero-text-strong) !important; }
/* Listas y marcadores */
.auth-hero ul, .auth-hero ol{ color: var(--hero-text); }
.auth-hero li::marker{ color: rgba(255,255,255,.46); }
/* Enlaces en el hero */
.auth-hero a{ color: var(--hero-link); text-decoration: none; }
.auth-hero a:hover{ color:#fff; text-decoration: underline; text-underline-offset: 2px; }
/* Badge de marca */
.auth-hero .brand-badge{
  color:#fff;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}

/* ---------- Tarjeta del formulario (lado derecho) ---------- */
.card-glass{
  position: relative;
  z-index: 1; /* sobre la línea central */
  background: var(--panel-bg);
  border: 1px solid var(--panel-bd);
  border-radius: 18px;
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  backdrop-filter: blur(6px) saturate(1.05);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card-glass:hover,
.card-glass:focus-within{
  background: var(--panel-bg-hover);
  border-color: var(--panel-bd-hover);
  box-shadow: var(--panel-shadow-hover);
  transform: translateY(-1px);
}
/* Tipografía dentro del panel */
.card-glass .form-label{ color:#334155; }         /* slate-700 */
.card-glass .text-muted{ color:#64748b; }         /* slate-500/600 */
.card-glass .small, .card-glass small{ color:#6b7280; }
/* Separadores internos */
.card-glass .divider,
.card-glass hr{
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15,23,42,.08), transparent);
  margin: 1.25rem 0;
}

/* ---------- Inputs / addons / estados ---------- */
.input-group-text{
  background:#f5f7fb;
  border:1px solid #e6ecf3;
}
.form-control{
  background:#fbfcfe;
  border:1px solid #e6ecf3;
  color:#1b2430;
}
.form-control.bg-darkish{ /* compat con versiones previas */
  background:#fbfcfe;
  border:1px solid #e6ecf3;
  color:#1b2430;
}
.form-control::placeholder{ color:#97a1ad; }
.form-control:focus{
  border-color:#c9d6ff;
  box-shadow: 0 0 0 .25rem rgba(79,123,255,.12);
}

/* Checkbox / labels deshabilitados (p. ej., “Recordarme próximamente”) */
.form-check-input:disabled ~ .form-check-label,
.form-check-label.disabled{
  color:#9aa4b2;
}

/* ---------- Botones ---------- */
.btn-primary{
  background: var(--auth-accent);
  border-color: var(--auth-accent);
}
.btn-primary:hover,
.btn-primary:focus{
  filter: brightness(0.96);
  box-shadow: 0 0 0 .2rem rgba(79,123,255,.18);
}

/* Botones secundarios (icono mostrar/ocultar pass, etc.) */
.btn.btn-outline-secondary{
  color:#475569;
  background:#ffffff;
  border-color:#e6ecf3;
}
.btn.btn-outline-secondary:hover,
.btn.btn-outline-secondary:focus{
  color:#1f2a37;
  background:#f7f9fc;
  border-color:#d7dfeb;
  box-shadow: 0 0 0 .2rem rgba(79,123,255,.10);
}

/* Links dentro del panel */
.card-glass a{
  color: var(--auth-accent);
  text-decoration: none;
}
.card-glass a:hover{
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Accesibilidad: reduce motion ---------- */
@media (prefers-reduced-motion: reduce){
  .card-glass{ transition: none; }
}

/* ===== LAYOUT ADMIN ===== */
.layout{ display:flex; min-height:100vh; background:#f6f8fb; }
.sidebar{
  width:260px; background:#ffffff; border-right:1px solid #e9edf3;
  position:sticky; top:0; height:100vh; padding:12px 10px; z-index:1040;
  overflow:hidden;                /* evita desbordes al colapsar */
  transition: width .2s ease;     /* animación suave del colapso */
}
.sidebar .brand{ font-weight:700; font-size:18px; padding:10px 12px; }
.sidebar .nav-link{
  display:flex; align-items:center; gap:10px; color:#3b4452; border-radius:10px;
  padding:10px 12px; margin:4px 2px; font-weight:500;
}
.sidebar .nav-link:hover{ background:#f2f5f9; }
.sidebar .nav-link.active{ background:#e9f0ff; color:#2a62ff; }
.sidebar .section-title{ padding:6px 12px; font-size:11px; letter-spacing:.06em; }

.main{ flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar{ position:sticky; top:0; z-index:1030; background:#ffffff; border-bottom:1px solid #e9edf3; }
.topbar .search{ max-width:360px; }
.content{ padding:18px; }
.footer{ background:#ffffff; border-top:1px solid #e9edf3; color:#7a8aa0; }

/* Overlay para off-canvas móvil */
.overlay{ position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:1035; display:none; }
body.sidebar-open .overlay{ display:block; }
body.sidebar-open{ overflow:hidden; } /* bloquea scroll al abrir menú en móvil */

/* Sidebar off-canvas en móvil */
@media (max-width: 991.98px){
  .sidebar{
    position:fixed; left:0; transform:translateX(-100%);
    transition: transform .2s ease, width .2s ease;
  }
  body.sidebar-open .sidebar{ transform:translateX(0); box-shadow:0 10px 40px rgba(0,0,0,.2); }
}

/* Colapso (desktop) */
body.sidebar-collapsed .sidebar{ width:72px; }
body.sidebar-collapsed .sidebar .brand{ justify-content:center; }
body.sidebar-collapsed .sidebar .brand span,
body.sidebar-collapsed .sidebar .section-title,
body.sidebar-collapsed .sidebar .nav-link .label{ display:none; }
body.sidebar-collapsed .sidebar .nav-link{ padding:10px; gap:0; justify-content:center; }

/* Botón icon-only (topbar) */
.btn-icon{ padding:6px 10px; border-radius:12px; line-height:1; }
.btn-icon i{ font-size:18px; }

/* ===== DASHBOARD ===== */
.card { border:1px solid #e9edf3; border-radius:14px; }
.card-header { border-bottom:1px solid #eef2f7; font-weight:600; }

.kpi-icon{ width:46px; height:46px; display:grid; place-items:center;
  border-radius:50%; background:#eef4ff; color:#2a62ff; }
.kpi-value{ font-size:1.35rem; font-weight:700; }

.badge-status{ text-transform:capitalize; }
.badge-status.contactar{ background:#ffd166; }
.badge-status.esperando_material{ background:#f6bd60; }
.badge-status.en_desarrollo{ background:#5bbd8d; }
.badge-status.en_revision{ background:#6fb1ff; }
.badge-status.en_modificaciones{ background:#ef8354; }
.badge-status.entregado{ background:#9fd356; }
.badge-status.archivado{ background:#a0aec0; }

.empty{ height:300px; display:flex; align-items:center; justify-content:center; color:#98a2b3; }

/* ===== Ajustes móviles ===== */
@media (max-width: 575.98px){
  .content{ padding:12px; }
  .card .card-body{ padding:12px; }
  .card-header{ font-size:.95rem; }
  .kpi-icon{ width:40px; height:40px; }
  .kpi-value{ font-size:1.1rem; }

  /* Oculta el buscador de escritorio en XS… */
  .topbar .search{ display:none !important; }

  /* …pero muestra el del collapse móvil a ancho completo */
  #topSearch .search{ display:flex !important; max-width:100%; }

  /* botón más sutil en xs */
  .topbar .btn-icon{ border:1px solid #d9dee7; }
}

/* agrega esto a tu CSS global */
#globalSearchResults li.active { background: var(--bs-primary-bg-subtle); }
#globalSearchResults a { text-decoration: none; }
#globalSearchResults mark { padding: 0 .1em; }

/* Truncar textos largos en Evento/Descripción en pantallas medianas */
#dash-activity td .truncate { 
  display:inline-block; 
  max-width: 360px; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
}
@media (max-width: 991.98px){
  #dash-activity td .truncate { max-width: 240px; }
}

/* En móvil, ocultar Descripción (col 2) y Actor (col 3) */
@media (max-width: 767.98px){
  #dash-activity thead th:nth-child(2),
  #dash-activity tbody td:nth-child(2),
  #dash-activity thead th:nth-child(3),
  #dash-activity tbody td:nth-child(3) { display: none; }
}

/* Filtros compactos en móvil */
@media (max-width: 767.98px){
  #emailFilters .form-label { font-size:.8rem; margin-bottom:.25rem; }
}

/* Paginación desplazable (igual que Kardex) */
.pagination-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pagination-scroll .pagination { white-space: nowrap; }

/* Botones cuadraditos y alineados (Topbar) */
.topbar .btn-icon{
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar .dropdown > .btn { height: 36px; }

/* Asegurar superposición y no recorte */
.topbar { overflow: visible; }
#globalSearchResults, #globalSearchResultsM { z-index:1060; }

/* Forzar que el buscador móvil SÍ se vea, sin pelear con .topbar .search */
#topSearch .search-m { display:flex !important; max-width:100%; }

