: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 ADMIN ===== */
.layout {
  display: block;
  /* Removed flex, now using standard block layout */
  min-height: 100vh;
  background: #f4f7fb;
  position: relative;
  width: 100%;
}

/* ---- Sidebar Base ---- */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafc 100%);
  border-right: 1px solid rgba(0, 0, 0, .06);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  padding: 16px 12px;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .25s cubic-bezier(.4, 0, .2, 1), box-shadow .25s ease, transform .25s ease;
  box-shadow: 2px 0 20px rgba(0, 0, 0, .03);
  flex-shrink: 0;
}

/* Deshabilitar interacciones durante transición */
body.sidebar-transitioning .sidebar,
body.sidebar-transitioning .main {
  pointer-events: none;
}

/* ---- Brand / Logo ---- */
.sidebar .brand {
  font-weight: 800;
  font-size: 20px;
  padding: 12px 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.sidebar .brand::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(42, 98, 255, .15), transparent);
}

.sidebar .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f7bff 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 123, 255, .35);
  transition: transform .3s ease, box-shadow .3s ease;
}

.sidebar .brand-icon i {
  font-size: 18px;
  color: #ffffff;
}

.sidebar .brand:hover .brand-icon {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 6px 18px rgba(79, 123, 255, .45);
}

.sidebar .brand-text {
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Sidebar Nav Container ---- */
.sidebar .sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 24px 0;
  margin-top: 8px;
  scroll-behavior: smooth;
  width: 100%;
  flex-wrap: nowrap !important;
  /* Fixes bootstrap .nav wrapping issue */
  flex-direction: column;
  /* Ensure vertical stacking */
}

/* ---- Nav Section ---- */
.sidebar .nav-section {
  margin-bottom: 4px;
}

/* ---- Section Toggle (Headers) ---- */
.sidebar .section-toggle {
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all .2s ease;
  overflow: hidden;
}

.sidebar .section-toggle span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.sidebar .section-toggle:hover {
  color: #4f7bff;
  background: rgba(79, 123, 255, .06);
}

.sidebar .section-toggle .collapse-arrow {
  font-size: 11px;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  opacity: .6;
}

.sidebar .section-toggle:hover .collapse-arrow {
  opacity: 1;
}

.sidebar .section-toggle.collapsed .collapse-arrow {
  transform: rotate(-90deg);
}

.sidebar .section-toggle:focus-visible {
  outline: 2px solid rgba(79, 123, 255, .4);
  outline-offset: 2px;
}

/* ---- Submenu Container ---- */
.sidebar .submenu {
  padding: 4px 0;
}

/* ---- Nav Links ---- */
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #475569;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 2px 6px;
  font-weight: 500;
  font-size: 14px;
  position: relative;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  text-decoration: none;
  overflow: hidden;
  max-width: 100%;
}

.sidebar .nav-link .nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s ease;
  flex-shrink: 0;
}

.sidebar .nav-link .nav-icon i {
  font-size: 15px;
  color: #64748b;
  transition: color .2s ease;
}

.sidebar .nav-link .label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hover State */
.sidebar .nav-link:hover {
  background: rgba(79, 123, 255, .06);
  color: #1e40af;
  transform: translateX(2px);
}

.sidebar .nav-link:hover .nav-icon {
  background: linear-gradient(135deg, rgba(79, 123, 255, .12) 0%, rgba(124, 58, 237, .1) 100%);
}

.sidebar .nav-link:hover .nav-icon i {
  color: #4f7bff;
}

/* Active State */
.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(79, 123, 255, .1) 0%, rgba(79, 123, 255, .04) 100%);
  color: #2563eb;
  font-weight: 600;
}

.sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #4f7bff 0%, #7c3aed 100%);
  box-shadow: 0 0 8px rgba(79, 123, 255, .5);
}

.sidebar .nav-link.active .nav-icon {
  background: linear-gradient(135deg, #4f7bff 0%, #7c3aed 100%);
  box-shadow: 0 3px 10px rgba(79, 123, 255, .3);
}

.sidebar .nav-link.active .nav-icon i {
  color: #ffffff;
}

/* ---- Custom Scrollbar ---- */
.sidebar .sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar .sidebar-nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #cbd5e1 0%, #e2e8f0 100%);
  border-radius: 10px;
}

.sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.sidebar .sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

/* ---- Section Title (legacy support) ---- */
.sidebar .section-title {
  padding: 8px 14px;
  font-size: 10px;
  letter-spacing: .08em;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
}

.main {
  margin-left: 260px;
  /* Push content to the right */
  display: block;
  min-width: 0;
  position: relative;
  transition: margin-left .25s cubic-bezier(.4, 0, .2, 1);
  min-height: 100vh;
}

.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(15, 23, 42, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1035;
  display: none;
  transition: opacity .25s ease;
}

body.sidebar-open .overlay {
  display: block;
}

body.sidebar-open {
  overflow: hidden;
}

/* Sidebar off-canvas en móvil */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1), box-shadow .25s ease;
    box-shadow: none;
    z-index: 1050;
    /* Ensure high z-index on mobile */
  }

  .main {
    margin-left: 0 !important;
    /* Reset margin on mobile */
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, .18);
  }
}

/* Colapso (desktop) */
body.sidebar-collapsed .sidebar {
  width: 76px;
  padding: 16px 8px;
}

body.sidebar-collapsed .main {
  margin-left: 76px;
}

body.sidebar-collapsed .sidebar .brand {
  justify-content: center;
  padding: 12px 8px 18px;
}

body.sidebar-collapsed .sidebar .brand::after {
  left: 8px;
  right: 8px;
}

body.sidebar-collapsed .sidebar .brand-text {
  display: none;
}

/* Ocultar títulos de sección y labels en modo colapsado */
body.sidebar-collapsed .sidebar .section-toggle {
  display: none;
}

body.sidebar-collapsed .sidebar .section-title {
  display: none;
}

/* Los colapsos siempre visibles en modo colapsado */
body.sidebar-collapsed .sidebar .collapse {
  display: block !important;
  height: auto !important;
}

body.sidebar-collapsed .sidebar .nav-link .label {
  display: none;
}

body.sidebar-collapsed .sidebar .nav-link {
  padding: 8px;
  gap: 0;
  justify-content: center;
  margin: 2px 4px;
  position: relative;
}

body.sidebar-collapsed .sidebar .nav-link .nav-icon {
  width: 38px;
  height: 38px;
}

body.sidebar-collapsed .sidebar .nav-link.active::before {
  top: 6px;
  bottom: 6px;
}

/* Tooltip en hover para modo colapsado */
body.sidebar-collapsed .sidebar .nav-link::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 1100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

body.sidebar-collapsed .sidebar .nav-link::before {
  /* Mantener el indicador activo pero ajustar z-index */
  z-index: 1;
}

body.sidebar-collapsed .sidebar .nav-link:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Submenu spacing en colapsado */
body.sidebar-collapsed .sidebar .submenu {
  padding: 2px 0;
}

body.sidebar-collapsed .sidebar .nav-section {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}

body.sidebar-collapsed .sidebar .nav-section:last-child {
  border-bottom: none;
}

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

.btn-icon i {
  font-size: 18px;
}

/* ===== GLOBAL SEARCH STYLES ===== */
/* Badge colors for search results */
.text-bg-primary {
  background-color: #0d6efd !important;
  color: #fff !important;
}

.text-bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

.text-bg-success {
  background-color: #198754 !important;
  color: #fff !important;
}

.text-bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

.text-bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

.text-bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

.text-bg-light {
  background-color: #f8f9fa !important;
  color: #000 !important;
}

.text-bg-dark {
  background-color: #212529 !important;
  color: #fff !important;
}

.text-bg-purple {
  background-color: #7c3aed !important;
  color: #fff !important;
}

/* Search results container */
#globalSearchResults,
#globalSearchResultsM {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .12);
  max-height: 60vh;
  overflow-y: auto;
  background: #fff;
}

#globalSearchResults .list-group-item,
#globalSearchResultsM .list-group-item {
  border-left: 0;
  border-right: 0;
  padding: 12px 16px;
  background: #fff;
}

#globalSearchResults .list-group-item:first-child,
#globalSearchResultsM .list-group-item:first-child {
  border-top: 0;
  border-radius: 12px 12px 0 0;
}

#globalSearchResults .list-group-item:last-child,
#globalSearchResultsM .list-group-item:last-child {
  border-bottom: 0;
  border-radius: 0 0 12px 12px;
}

#globalSearchResults .list-group-item:hover,
#globalSearchResultsM .list-group-item:hover,
#globalSearchResults .list-group-item.active,
#globalSearchResultsM .list-group-item.active {
  background: #f1f5f9 !important;
}

#globalSearchResults .list-group-item a,
#globalSearchResultsM .list-group-item a {
  color: #1e293b;
}

#globalSearchResults .list-group-item:hover a,
#globalSearchResultsM .list-group-item:hover a,
#globalSearchResults .list-group-item.active a,
#globalSearchResultsM .list-group-item.active a {
  color: #4f7bff;
}

/* Badge styles with high specificity */
#globalSearchResults .badge,
#globalSearchResultsM .badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

#globalSearchResults .badge.text-bg-primary,
#globalSearchResultsM .badge.text-bg-primary {
  background-color: #4f7bff !important;
  color: #fff !important;
}

#globalSearchResults .badge.text-bg-info,
#globalSearchResultsM .badge.text-bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

#globalSearchResults .badge.text-bg-success,
#globalSearchResultsM .badge.text-bg-success {
  background-color: #10b981 !important;
  color: #fff !important;
}

#globalSearchResults .badge.text-bg-warning,
#globalSearchResultsM .badge.text-bg-warning {
  background-color: #f59e0b !important;
  color: #000 !important;
}

#globalSearchResults .badge.text-bg-danger,
#globalSearchResultsM .badge.text-bg-danger {
  background-color: #ef4444 !important;
  color: #fff !important;
}

#globalSearchResults .badge.text-bg-secondary,
#globalSearchResultsM .badge.text-bg-secondary {
  background-color: #64748b !important;
  color: #fff !important;
}

#globalSearchResults .badge.text-bg-dark,
#globalSearchResultsM .badge.text-bg-dark {
  background-color: #1e293b !important;
  color: #fff !important;
}

#globalSearchResults .badge.text-bg-light,
#globalSearchResultsM .badge.text-bg-light {
  background-color: #e2e8f0 !important;
  color: #334155 !important;
}

#globalSearchResults .badge.text-bg-purple,
#globalSearchResultsM .badge.text-bg-purple {
  background-color: #7c3aed !important;
  color: #fff !important;
}

#globalSearchResults mark,
#globalSearchResultsM mark {
  background: rgba(79, 123, 255, .25);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* ===== DASHBOARD (General / Old) ===== */
.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;
}

/* Status Badges */
.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;
  }
}

/* Global Search & Utils */
#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%;
}

/* === KPIs / KRIs LEADS (Versión Específica) === */

.lead-kpi-widget {
  border-radius: 16px;
  border: 1px solid #edf0ff;
  padding: 16px 18px;
  background-color: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .04);
}

.lead-kpi-widget h6 {
  font-size: 0.9rem;
  font-weight: 600;
}

.lead-kpi-main {
  font-size: 1.6rem;
  font-weight: 700;
}

.lead-kpi-sub {
  font-size: 0.8rem;
  color: #64748b;
}

.lead-kpi-badge-kpi,
.lead-kpi-badge-kri {
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 2px 8px;
  font-weight: 600;
}

/* color rey / morado principal */
.lead-kpi-badge-kpi {
  background-color: #eef2ff;
  color: #4f46e5;
}

.lead-kpi-badge-kri {
  background-color: #fef2f2;
  color: #b91c1c;
}

.lead-kpi-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lead-kpi-circle-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: #f5f3ff;
}

.lead-kpi-circle-inner {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.lead-kpi-add {
  border-radius: 16px;
  border: 1px dashed #d4d4ff;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fafafe;
  cursor: pointer;
}

.lead-kpi-add:hover {
  background-color: #f1f0ff;
  border-color: #a5b4fc;
}

.border-dashed {
  border-style: dashed !important;
}

/* =========================================================
   PROJECTS CARD (Minimalist Style)
   ========================================================= */

.project-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.02, 0.01, 0.47, 1);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(14, 16, 32, 0.08);
  /* Sombra suave basada en --ink */
  border-color: #dbeafe;
}

/* Barra lateral decorativa (detalle azul oscuro) */
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--ink-3);
  /* Azul oscuro */
  opacity: 0;
  transition: opacity 0.2s;
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-title {
  color: var(--ink-3);
  /* Azul oscuro para el título */
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.project-card-code {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.project-label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.project-value {
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Workflow Badge minimalista */
.workflow-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: #f8fafc;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

.workflow-pill i {
  color: var(--brand);
  /* Azul brillante para el icono */
  margin-right: 6px;
}

/* Precio destacado pero limpio */
.project-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: -0.5px;
}

.btn-action-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #64748b;
  transition: .2s;
  background: transparent;
  border: 1px solid transparent;
}

.btn-action-icon:hover {
  background: #f1f5f9;
  color: var(--brand);
}

.btn-action-icon.danger:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* =========================================================
   SUPPORT & LEADS - UI Mejorada
   ========================================================= */

/* === Header de página === */
.page-header {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.page-header-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.page-header h4 {
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.25rem;
}

.page-header .lead {
  color: #6c757d;
  font-size: 0.875rem;
}

/* === KPI/KRI Cards Mejoradas === */
.kpi-widget {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  padding: 1.25rem;
  height: 100%;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-widget:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.kpi-widget::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.kpi-widget.kpi-success::after {
  background: #198754;
}

.kpi-widget.kpi-danger::after {
  background: #dc3545;
}

.kpi-widget.kpi-warning::after {
  background: #ffc107;
}

.kpi-widget.kpi-primary::after {
  background: #0d6efd;
}

.kpi-widget.kpi-info::after {
  background: #0dcaf0;
}

.kpi-widget.kpi-secondary::after {
  background: #6c757d;
}

.kpi-widget-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.kpi-widget.kpi-success .kpi-widget-icon {
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
}

.kpi-widget.kpi-danger .kpi-widget-icon {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.kpi-widget.kpi-warning .kpi-widget-icon {
  background: rgba(255, 193, 7, 0.12);
  color: #cc9a06;
}

.kpi-widget.kpi-primary .kpi-widget-icon {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
}

.kpi-widget.kpi-info .kpi-widget-icon {
  background: rgba(13, 202, 240, 0.1);
  color: #0dcaf0;
}

.kpi-widget.kpi-secondary .kpi-widget-icon {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

.kpi-widget-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-widget.kpi-success .kpi-widget-value {
  color: #198754;
}

.kpi-widget.kpi-danger .kpi-widget-value {
  color: #dc3545;
}

.kpi-widget.kpi-warning .kpi-widget-value {
  color: #cc9a06;
}

.kpi-widget.kpi-primary .kpi-widget-value {
  color: #0d6efd;
}

.kpi-widget.kpi-info .kpi-widget-value {
  color: #0dcaf0;
}

.kpi-widget.kpi-secondary .kpi-widget-value {
  color: #6c757d;
}

.kpi-widget-label {
  font-size: 0.875rem;
  color: #495057;
  font-weight: 600;
}

.kpi-widget-desc {
  font-size: 0.75rem;
  color: #6c757d;
}

.kpi-widget-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.kpi-widget-badge.badge-kpi {
  background: #e0f2fe;
  color: #0369a1;
}

.kpi-widget-badge.badge-kri {
  background: #fee2e2;
  color: #b91c1c;
}

/* Donut para porcentajes */
.kpi-donut {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-donut-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.kpi-donut-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

/* Widget agregar */
.kpi-widget-add {
  border-radius: 16px;
  border: 2px dashed #dee2e6;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kpi-widget-add:hover {
  background: #f0f0f0;
  border-color: #adb5bd;
}

.kpi-widget-add .add-icon {
  font-size: 2rem;
  color: #adb5bd;
}

.kpi-widget-add:hover .add-icon {
  color: #0d6efd;
}

/* === Filtros Card === */
.filters-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filters-card .card-header {
  background: #ffffff;
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem;
}

.filters-card .form-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.filters-card .form-control,
.filters-card .form-select {
  border-radius: 10px;
  border-color: #dee2e6;
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
}

.filters-card .form-control:focus,
.filters-card .form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.filters-card .input-group-text {
  background: #fff;
  border-color: #dee2e6;
  color: #6c757d;
}

/* === Tabla Moderna === */
.table-modern {
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead th {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  font-weight: 700;
  padding: 1rem 1.25rem;
  white-space: nowrap;
}

.table-modern tbody tr {
  transition: background 0.15s ease;
}

.table-modern tbody tr:hover {
  background: #f8f9fa;
}

.table-modern tbody td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
  color: #212529;
}

.table-modern .row-id {
  font-weight: 700;
  color: #0d6efd;
}

.table-modern .row-title {
  font-weight: 600;
  color: #212529;
}

.table-modern .row-subtitle {
  font-size: 0.8rem;
  color: #6c757d;
}

/* Finance tabs */
.finance-tabs .nav-link {
  color: #6c757d;
  font-weight: 600;
}

.finance-tabs .nav-link.active {
  background: #ffffff;
  color: #212529;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Badges de prioridad y estado */
.badge-priority,
.badge-status {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Botones de acción en tabla */
.btn-table-action {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.btn-table-action:hover {
  transform: scale(1.05);
}

/* Empty state */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f1f3f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.empty-state-icon i {
  font-size: 2rem;
  color: #adb5bd;
}

.empty-state h6 {
  color: #495057;
  font-weight: 600;
}

.empty-state p {
  color: #6c757d;
  font-size: 0.875rem;
}

/* Paginación moderna */
.pagination-modern .page-item .page-link {
  border-radius: 8px;
  margin: 0 3px;
  border: none;
  color: #495057;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  background: transparent;
}

.pagination-modern .page-item .page-link:hover {
  background: #e9ecef;
  color: #212529;
}

.pagination-modern .page-item.active .page-link {
  background: #0d6efd;
  color: #fff;
}

.pagination-modern .page-item.disabled .page-link {
  color: #adb5bd;
}

/* === Modal Moderno === */
.modal-modern .modal-content {
  border-radius: 20px;
  border: none;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-modern .modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1.5rem;
  background: #fafafa;
}

.modal-modern .modal-title {
  font-weight: 700;
}

.modal-modern .modal-body {
  padding: 1.5rem;
}

.modal-modern .modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1rem 1.5rem;
  background: #fafafa;
}

/* === Vista detalle ticket === */
.ticket-detail-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #dee2e6;
}

.ticket-detail-id {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d6efd;
}

.ticket-detail-subject {
  font-size: 1.25rem;
  font-weight: 600;
  color: #212529;
}

/* Conversación estilo chat */
.conversation-container {
  max-height: 500px;
  overflow-y: auto;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.message-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.message-item.message-internal {
  background: #fff8e6;
  border-radius: 12px;
  padding: 0.75rem;
  border: 1px dashed #ffc107;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.message-avatar.avatar-staff {
  background: #0d6efd;
  color: #fff;
}

.message-avatar.avatar-client {
  background: #6c757d;
  color: #fff;
}

.message-bubble {
  background: #fff;
  border-radius: 12px;
  padding: 0.875rem 1rem;
  border: 1px solid #e9ecef;
  flex: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.message-meta {
  font-size: 0.7rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.message-text {
  color: #212529;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Info card lateral */
.info-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

.info-card-header {
  background: #f8f9fa;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  font-size: 0.875rem;
}

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

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f3f5;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.info-row-value {
  font-weight: 600;
  color: #212529;
  font-size: 0.875rem;
}

/* === Leads específico === */
.lead-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
  overflow: hidden;
}

.lead-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: #dee2e6;
}

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

.lead-name {
  font-weight: 700;
  color: #212529;
  font-size: 1rem;
}

.lead-contact {
  font-size: 0.8rem;
  color: #6c757d;
}

.lead-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #198754;
}

/* Botones de estado (toggle) */
.btn-group-status .btn {
  border-radius: 8px !important;
  margin-right: 4px;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

.btn-group-status .btn.active {
  font-weight: 600;
}

/* Animación de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.3s ease forwards;
}

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

  .page-header-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .kpi-widget {
    padding: 1rem;
  }

  .kpi-widget-value {
    font-size: 1.5rem;
  }

  .table-modern thead th,
  .table-modern tbody td {
    padding: 0.75rem 1rem;
  }

  .filters-card .card-header {
    padding: 1rem;
  }

  .kardex-header,
  .catalog-card .card-header {
    padding: 1rem 1.25rem;
  }

  .kardex-header-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .kardex-filters-body,
  .catalog-filters {
    padding: 1rem;
  }

  .kardex-table thead th,
  .kardex-table tbody td,
  .catalog-table thead th,
  .catalog-table tbody td {
    padding: 0.75rem 0.875rem;
  }

  .catalog-tabs .nav-link {
    padding: 0.6rem 0.875rem;
    font-size: 0.8rem;
  }

  .catalog-body {
    padding: 1rem;
  }
}

/* === DASHBOARD === */
.dashboard-header {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* KPI Cards principales del dashboard */
.dash-kpi-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
  overflow: hidden;
}

.dash-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.dash-kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.dash-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: #212529;
}

.dash-kpi-label {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 500;
}

/* === Finance KPIs === */
.finance-kpi-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.finance-kpi-label {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 600;
}

.finance-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.finance-kpi-sub {
  font-size: 0.75rem;
  color: #6c757d;
}

.finance-kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

/* Panel de widgets configurables */
.dash-panel {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Eliminar gradiente de dash-panel-header */
.dash-panel-header {
  background: #ffffff;
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
}

.dash-panel-title {
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.25rem;
}

.dash-panel-subtitle {
  font-size: 0.8rem;
  color: #6c757d;
}

.dash-panel-body {
  padding: 1.5rem;
}

/* Widgets dentro del panel */
.dash-widget {
  background: #fafafa;
  border-radius: 14px;
  border: 1px solid #e9ecef;
  padding: 1.25rem;
  height: 100%;
  position: relative;
  transition: all 0.2s ease;
}

.dash-widget:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.dash-widget::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  bottom: 1rem;
  width: 4px;
  border-radius: 0 4px 4px 0;
}

.dash-widget.widget-kpi::before {
  background: #0d6efd;
}

.dash-widget.widget-kri::before {
  background: #dc3545;
}

.dash-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.dash-widget-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #495057;
}

.dash-widget-badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.dash-widget-badge.badge-kpi {
  background: #dbeafe;
  color: #1d4ed8;
}

.dash-widget-badge.badge-kri {
  background: #fee2e2;
  color: #b91c1c;
}

.dash-widget-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #212529;
}

.dash-widget-desc {
  font-size: 0.7rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

/* Donut para porcentajes en dashboard */
.dash-donut {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-donut-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.dash-donut-inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  position: relative;
  z-index: 1;
}

/* Acciones rápidas */
.quick-actions-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
}

.quick-actions-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
}

.quick-actions-body {
  padding: 1.25rem;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  color: #495057;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 0.5rem;
}

.quick-action-btn:last-child {
  margin-bottom: 0;
}

.quick-action-btn:hover {
  background: #e9ecef;
  color: #212529;
  transform: translateX(4px);
}

.quick-action-btn i {
  font-size: 1.1rem;
  color: #0d6efd;
}

/* Alertas & riesgos */
.alerts-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
}

.alerts-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
}

.alerts-body {
  padding: 1.25rem;
}

.alert-item {
  padding: 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  border: 1px solid;
}

.alert-item:last-child {
  margin-bottom: 0;
}

.alert-item.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.alert-item.alert-warning {
  background: #fffbeb;
  border-color: #fed7aa;
}

.alert-item-title {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.alert-item-link {
  font-size: 0.8rem;
  text-decoration: none;
  color: #374151;
}

.alert-item-link:hover {
  text-decoration: underline;
}

.alert-item-meta {
  font-size: 0.7rem;
  color: #6b7280;
}

/* Gráficos cards */
.chart-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

.chart-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  background: #fafafa;
}

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

/* Actividad reciente */
.activity-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

.activity-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-badge {
  background: #f3f4f6;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
}

/* === CLIENTS === */
.clients-header {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.clients-header-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Client cards (grid view) */
.client-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
  overflow: hidden;
  height: 100%;
}

.client-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: #dee2e6;
}

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

.client-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* === KARDEX === */
.kardex-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid #dee2e6;
}

.kardex-header-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Tabs Kardex */
.kardex-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem;
  background: #f1f3f5;
  border-radius: 10px;
  width: fit-content;
}

.kardex-tabs .nav-link {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  color: #6c757d;
  border: none;
  background: transparent;
  transition: all 0.15s ease;
}

.kardex-tabs .nav-link:hover {
  color: #212529;
  background: rgba(255, 255, 255, 0.5);
}

.kardex-tabs .nav-link.active {
  background: #fff;
  color: #0d6efd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Filtros Kardex */
.kardex-filters {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.kardex-filters-header {
  background: #fafafa;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kardex-filters-body {
  padding: 1.25rem;
}

/* Tabla Kardex */
.kardex-table {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

.kardex-table thead th {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  font-weight: 700;
  padding: 1rem 1.25rem;
  white-space: nowrap;
}

.kardex-table tbody tr {
  transition: background 0.15s ease;
}

.kardex-table tbody tr:hover {
  background: #f8f9fa;
}

.kardex-table tbody td {
  padding: 0.875rem 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.875rem;
}

.kardex-table .card-footer {
  background: #fafafa;
  border-top: 1px solid #e9ecef;
  padding: 1rem 1.25rem;
}

/* Badges de severidad */
.badge-severity {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-severity.severity-info {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-severity.severity-low {
  background: #d1fae5;
  color: #047857;
}

.badge-severity.severity-medium {
  background: #fef3c7;
  color: #b45309;
}

.badge-severity.severity-high {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-severity.severity-critical {
  background: #dc3545;
  color: #fff;
}

/* Detalle expandible */
.kardex-detail {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.kardex-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.kardex-detail-item {
  background: #fff;
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid #e9ecef;
}

.kardex-detail-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.kardex-detail-value {
  font-weight: 600;
  color: #212529;
  font-size: 0.875rem;
  word-break: break-word;
}

/* === SERVICE CATALOG === */
.catalog-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.catalog-card .card-header {
  background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
  padding: 1.5rem;
}

.catalog-body {
  padding: 1.5rem;
}

/* Tabs del catálogo */
.catalog-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: -1px;
}

.catalog-tabs .nav-item {
  margin-bottom: -2px;
}

.catalog-tabs .nav-link {
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: #6c757d;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  transition: all 0.15s ease;
}

.catalog-tabs .nav-link:hover {
  color: #212529;
  border-bottom-color: #dee2e6;
}

.catalog-tabs .nav-link.active {
  color: #0d6efd;
  border-bottom-color: #0d6efd;
}

/* Filtros del catálogo */
.catalog-filters {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Botones de filtro tipo toggle */
.catalog-filter-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #dee2e6;
  background: #fff;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.15s ease;
}

.catalog-filter-btn:hover {
  background: #e9ecef;
  color: #212529;
}

.catalog-filter-btn.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

/* Toggle vista lista/grid */
.view-toggle {
  display: inline-flex;
  background: #e9ecef;
  border-radius: 8px;
  padding: 0.2rem;
}

.view-toggle .btn {
  padding: 0.35rem 0.6rem;
  border: none;
  background: transparent;
  color: #6c757d;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.view-toggle .btn:hover {
  color: #212529;
}

.view-toggle .btn.active {
  background: #fff;
  color: #0d6efd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tabla del catálogo */
.catalog-table {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

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

.catalog-table thead th {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  font-weight: 700;
  padding: 0.875rem 1rem;
  white-space: nowrap;
}

.catalog-table tbody tr {
  transition: background 0.15s ease;
}

.catalog-table tbody tr:hover {
  background: #f8f9fa;
}

.catalog-table tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.875rem;
}

/* Badges de facturación */
.badge-billing {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-billing.billing-onetime {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-billing.billing-monthly {
  background: #d1fae5;
  color: #047857;
}

.badge-billing.billing-yearly {
  background: #fef3c7;
  color: #b45309;
}

.badge-billing.billing-custom {
  background: #f3e8ff;
  color: #7c3aed;
}

/* Cards de categoría/plan (vista grid) */
.catalog-grid-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
  overflow: hidden;
  height: 100%;
}

.catalog-grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: #dee2e6;
}

.catalog-grid-card-body {
  padding: 1.25rem;
}

.catalog-grid-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.catalog-grid-card-title {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.25rem;
}

.catalog-grid-card-subtitle {
  font-size: 0.8rem;
  color: #6c757d;
}

.catalog-grid-card-footer {
  padding: 0.875rem 1.25rem;
  background: #fafafa;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Empty state del catálogo */
.catalog-empty {
  text-align: center;
  padding: 3rem 1.5rem;
}

.catalog-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f1f3f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.catalog-empty-icon i {
  font-size: 2rem;
  color: #adb5bd;
}

.catalog-empty h6 {
  color: #495057;
  font-weight: 600;
}

.catalog-empty p {
  color: #6c757d;
  font-size: 0.875rem;
}

/* Modal del catálogo */
.catalog-modal .modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.catalog-modal .modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
  background: #fafafa;
}

.catalog-modal .modal-header .modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.catalog-modal .modal-body {
  padding: 1.5rem;
}

.catalog-modal .modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1rem 1.5rem;
  background: #fafafa;
}

/* Tabla de atributos */
.attributes-table {
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

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

.attributes-table thead th {
  background: #f1f3f5;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #6c757d;
  font-weight: 600;
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
}

.attributes-table tbody td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
}

.attributes-table .attr-empty td {
  padding: 1rem;
  text-align: center;
  color: #6c757d;
  font-size: 0.875rem;
}

/* =========================================================
   FULLSCREEN SEARCH MODAL
   ========================================================= */

/* Search trigger button */
.search-trigger {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 14px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.search-trigger:hover {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-trigger kbd {
  background: #e2e8f0;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-family: inherit;
  color: #64748b;
}

/* Modal overlay and container */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  /* Centrado verticalmente en la parte superior */
}

.search-modal.show {
  display: flex;
}

.search-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 100px);
  margin: 20px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: searchModalSlideIn 0.2s ease-out;
}

@keyframes searchModalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Header with input */
.search-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #fafbfc;
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.search-input-icon {
  font-size: 20px;
  color: #94a3b8;
}

.search-modal-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 500;
  color: #1e293b;
  outline: none;
}

.search-modal-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.search-input-hints {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.search-input-hints kbd {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.7rem;
  color: #64748b;
}

@media (min-width: 768px) {
  .search-input-hints {
    display: flex;
  }
}

.search-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #64748b;
}

.search-modal-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Filters */
.search-filters {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.search-filters::-webkit-scrollbar {
  display: none;
}

.search-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-filter-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.search-filter-btn.active {
  background: linear-gradient(135deg, #4f7bff 0%, #7c3aed 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 123, 255, 0.3);
}

.search-filter-btn i {
  font-size: 14px;
}

/* Modal body */
.search-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  min-height: 300px;
  max-height: 50vh;
}

/* Sections */
.search-section {
  margin-bottom: 24px;
}

.search-section:last-child {
  margin-bottom: 0;
}

.search-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 12px;
}

/* Quick actions */
.search-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.search-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  text-decoration: none;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.search-quick-action:hover {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  color: #1e293b;
}

.search-quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

/* Recent searches */
.search-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #475569;
}

.search-recent-item:hover {
  background: #f1f5f9;
}

.search-recent-item i {
  font-size: 16px;
  color: #94a3b8;
}

.search-recent-item span {
  flex: 1;
  font-size: 0.9rem;
}

.search-recent-item .search-recent-remove {
  opacity: 0;
  padding: 4px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-recent-item:hover .search-recent-remove {
  opacity: 1;
}

.search-recent-item .search-recent-remove:hover {
  color: #ef4444;
}

/* Results status */
.search-results-status {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

/* Results list */
.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.search-result-item:hover,
.search-result-item.active {
  background: #f1f5f9;
}

.search-result-item.active {
  box-shadow: inset 0 0 0 2px #4f7bff;
}

.search-result-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 80px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
  display: block;
}

.search-result-title a {
  color: inherit;
  text-decoration: none;
}

.search-result-title a:hover {
  color: #4f7bff;
}

.search-result-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
}

.search-result-item mark {
  background: rgba(79, 123, 255, 0.2);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* Result type badges */
.search-result-badge.type-client {
  background: #dbeafe;
  color: #1d4ed8;
}

.search-result-badge.type-lead {
  background: #cffafe;
  color: #0891b2;
}

.search-result-badge.type-project {
  background: #dcfce7;
  color: #16a34a;
}

.search-result-badge.type-invoice {
  background: #fef3c7;
  color: #d97706;
}

.search-result-badge.type-ticket {
  background: #fee2e2;
  color: #dc2626;
}

.search-result-badge.type-plan {
  background: #f3e8ff;
  color: #9333ea;
}

.search-result-badge.type-template {
  background: #ede9fe;
  color: #7c3aed;
}

.search-result-badge.type-user {
  background: #f1f5f9;
  color: #475569;
}

.search-result-badge.type-role {
  background: #e2e8f0;
  color: #475569;
}

.search-result-badge.type-kardex {
  background: #fef3c7;
  color: #92400e;
}

.search-result-badge.type-email {
  background: #d1fae5;
  color: #059669;
}

/* Empty state */
.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.search-empty-state i {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.search-empty-state p {
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}

/* Loading state */
.search-loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: #64748b;
}

/* Footer */
.search-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
}

.search-footer-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.search-footer-tip i {
  color: #f59e0b;
}

.search-footer-tip kbd {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.75rem;
  color: #475569;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .search-modal {
    padding-top: 0;
    align-items: stretch;
  }

  .search-modal-dialog {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .search-modal-body {
    max-height: calc(100vh - 220px);
  }

  .search-quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Body state when modal is open */
body.search-modal-open {
  overflow: hidden;
}

/* =========================================================
   PROFILE PAGE STYLES
   ========================================================= */

/* Profile Header */
.profile-header {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.profile-header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: #f1f5f9;
}

.profile-header-content {
  position: relative;
  padding: 40px 30px 30px;
}

/* Avatar */
.profile-avatar-wrapper {
  flex-shrink: 0;
}

.profile-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar #avatar_placeholder {
  font-size: 72px;
  color: #cbd5e1;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.85rem;
}

.profile-avatar-overlay i {
  font-size: 24px;
  margin-bottom: 4px;
}

.profile-avatar:hover .profile-avatar-overlay {
  opacity: 1;
}

/* Header Info */
.profile-header-info {
  flex: 1;
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.profile-email {
  color: #64748b;
  font-size: 1rem;
  margin: 0;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-role-badge {
  background: linear-gradient(135deg, #4f7bff 0%, #7c3aed 100%);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-member-badge {
  background: #f1f5f9;
  color: #64748b;
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Profile Stats */
.profile-stats {
  display: flex;
  gap: 24px;
}

.profile-stat {
  text-align: center;
  padding: 16px 20px;
  background: #f8fafc;
  border-radius: 12px;
  min-width: 80px;
}

.profile-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

.profile-stat-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Profile Card & Tabs */
.profile-card {
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.profile-tabs {
  gap: 4px;
}

.profile-tabs .nav-link {
  border: none;
  border-radius: 10px 10px 0 0;
  padding: 12px 20px;
  color: #64748b;
  font-weight: 500;
  transition: all 0.2s ease;
}

.profile-tabs .nav-link:hover {
  background: #f8fafc;
  color: #1e293b;
}

.profile-tabs .nav-link.active {
  background: #fff;
  color: #4f7bff;
  box-shadow: 0 -2px 0 #4f7bff inset;
}

.profile-tabs .nav-link i {
  font-size: 1rem;
}

/* Sidebar Cards */
.profile-sidebar-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.profile-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.profile-info-list li:last-child {
  border-bottom: none;
}

.profile-info-label {
  color: #64748b;
  font-size: 0.875rem;
}

.profile-info-value {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.875rem;
}

.profile-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-tips-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.875rem;
  color: #475569;
}

.profile-tips-list li i {
  font-size: 1rem;
}

/* Password Strength Meter */
.password-strength {
  margin-top: 8px;
}

.password-strength-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.password-strength-fill.weak {
  background: #ef4444;
}

.password-strength-fill.medium {
  background: #f59e0b;
}

.password-strength-fill.strong {
  background: #10b981;
}

.password-strength-fill.very-strong {
  background: linear-gradient(90deg, #10b981, #059669);
}

.password-strength-text {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #64748b;
}

/* Activity Timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.activity-item:hover {
  background: #f1f5f9;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.activity-icon.bg-primary {
  background: linear-gradient(135deg, #4f7bff, #7c3aed);
}

.activity-icon.bg-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.activity-icon.bg-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.activity-icon.bg-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.activity-entity {
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  color: #475569;
}

.activity-link {
  align-self: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  transition: all 0.2s ease;
}

.activity-link:hover {
  background: #4f7bff;
  color: #fff;
}

/* Sessions List */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.session-card:hover {
  border-color: #cbd5e1;
}

.session-card.current {
  background: linear-gradient(135deg, rgba(79, 123, 255, 0.08), rgba(124, 58, 237, 0.08));
  border-color: #4f7bff;
}

.session-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #64748b;
}

.session-card.current .session-icon {
  background: linear-gradient(135deg, #4f7bff, #7c3aed);
  color: #fff;
}

.session-info {
  flex: 1;
}

.session-device {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.session-close {
  flex-shrink: 0;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification.toast-success {
  background: #10b981;
  color: #fff;
}

.toast-notification.toast-danger {
  background: #ef4444;
  color: #fff;
}

.toast-notification i {
  font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 767.98px) {
  .profile-header-content {
    padding: 80px 20px 20px;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-avatar #avatar_placeholder {
    font-size: 56px;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .profile-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 16px;
  }

  .profile-stat {
    min-width: 70px;
    padding: 12px 16px;
  }

  .profile-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .profile-tabs::-webkit-scrollbar {
    display: none;
  }

  .profile-tabs .nav-link {
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .profile-tabs .nav-link i {
    display: none;
  }

  .activity-meta {
    flex-direction: column;
    gap: 4px;
  }

  .session-meta {
    flex-direction: column;
    gap: 4px;
  }
}

/* =========================================================
   DASHBOARD STYLES
   ========================================================= */

/* Dashboard KPIs */
.dashboard-kpi {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.dashboard-kpi:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.dashboard-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dashboard-kpi-content {
  flex: 1;
  min-width: 0;
}

.dashboard-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.dashboard-kpi-label {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

/* Dashboard Actions */
.dashboard-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #475569;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}

.dashboard-action:last-child {
  border-bottom: none;
}

.dashboard-action:hover {
  background: #f8fafc;
  color: #1e293b;
}

.dashboard-action i:first-child {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #64748b;
}

.dashboard-action:hover i:first-child {
  background: #4f7bff;
  color: #fff;
}

.dashboard-action span {
  flex: 1;
  font-weight: 500;
}

.dashboard-action .bi-chevron-right {
  color: #cbd5e1;
  font-size: 0.875rem;
}

/* Dashboard Widgets */
.dashboard-widget {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.dashboard-widget:hover {
  border-color: #cbd5e1;
}

.dashboard-widget.is-kri {
  border-left: 3px solid #ef4444;
}

.dashboard-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.dashboard-widget-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.dashboard-widget-badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.dashboard-widget-badge.badge-kpi {
  background: #dbeafe;
  color: #2563eb;
}

.dashboard-widget-badge.badge-kri {
  background: #fee2e2;
  color: #dc2626;
}

.dashboard-widget-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

.dashboard-widget-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Dashboard Alerts */
.dashboard-alert {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid;
}

.dashboard-alert:last-child {
  margin-bottom: 0;
}

.dashboard-alert.danger {
  background: #fef2f2;
  border-color: #ef4444;
}

.dashboard-alert.warning {
  background: #fffbeb;
  border-color: #f59e0b;
}

.dashboard-alert-title {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.dashboard-alert.danger .dashboard-alert-title {
  color: #dc2626;
}

.dashboard-alert.warning .dashboard-alert-title {
  color: #d97706;
}

.dashboard-alert-content {
  font-size: 0.875rem;
  color: #1e293b;
}

.dashboard-alert-content a {
  color: inherit;
  text-decoration: none;
}

.dashboard-alert-content a:hover {
  text-decoration: underline;
}

.dashboard-alert-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

/* Dashboard Donut Mini */
.dashboard-donut {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-donut-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.dashboard-donut-inner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1e293b;
  position: relative;
  z-index: 1;
}

/* Widget Add Card */
.dashboard-widget-add {
  background: #fff;
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.dashboard-widget-add:hover {
  border-color: #4f7bff;
  background: #f8fafc;
}

.dashboard-widget-add .add-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #64748b;
}

.dashboard-widget-add:hover .add-icon {
  background: #4f7bff;
  color: #fff;
}

/* Widget Config Item (Modal) */
.widget-config-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
}

.widget-config-item:hover {
  border-color: #4f7bff;
}

.widget-config-item .form-check-input:checked {
  background-color: #4f7bff;
  border-color: #4f7bff;
}

/* Responsive */
@media (max-width: 767.98px) {
  .dashboard-kpi {
    padding: 16px;
    gap: 12px;
  }

  .dashboard-kpi-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .dashboard-kpi-value {
    font-size: 1.25rem;
  }

  .dashboard-kpi-label {
    font-size: 0.75rem;
  }
}