/* Admin layout: header fijo + sidebar con scroll propio. */
/* Prod note: versión 1.0 por Esnovapro Systems (2026-01-11). */

/* Ajusta si cambias la altura del header (#header). */
:root {
  --topbar-height: 57px;
  --sidebar-bottom-safe: 20px;
}

@media (min-width: 769px) {
  /* Sidebar fluido en desktop y ajustes de layout dependientes. */
  :root {
    --sidebar-width: clamp(200px, 16vw, 260px);
  }

  body.admin:not(.hide-sidebar):not(.page-small) #menu.sidebar,
  body.admin.page-small.show-sidebar #menu.sidebar,
  body.admin #setup-menu-wrapper {
    width: var(--sidebar-width);
  }

  body.admin:not(.hide-sidebar):not(.page-small) #wrapper,
  body.admin.page-small.show-sidebar #wrapper {
    margin-left: var(--sidebar-width);
  }

  body.admin.hide-sidebar:not(.show-sidebar) #menu,
  body.admin.page-small #menu {
    margin-left: calc(var(--sidebar-width) * -1);
  }

  body.admin.page-small.show-sidebar #menu {
    margin-left: 0;
  }

  body.admin .btn-bottom-toolbar {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }

  [dir="rtl"] body.admin:not(.hide-sidebar):not(.page-small) #wrapper,
  [dir="rtl"] body.admin.page-small.show-sidebar #wrapper {
    margin-left: 0;
    margin-right: var(--sidebar-width);
  }

  [dir="rtl"] body.admin .btn-bottom-toolbar {
    margin-left: 0;
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
}

body.admin #header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 101;
  width: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fd 100%);
  border-bottom: 1px solid #dbe5f2;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

/* Header: mismo lenguaje visual del sidebar */
body.admin #header nav,
body.admin #header .navbar,
body.admin #header .navbar-default {
  background: transparent !important;
  border: 0 !important;
}

body.admin #header #logo .logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.admin #header #logo .logo.logo-text {
  color: #0f172a !important;
}

body.admin #header #logo .logo img {
  display: block;
}

body.admin #header .header-user-menu > .header-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  border: 2px solid #d7e4f3;
  box-shadow: none;
  overflow: hidden !important;
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(circle at center, #000 99%, transparent 100%);
}

body.admin #header .header-user-menu > .header-user-avatar:hover,
body.admin #header .header-user-menu > .header-user-avatar:focus,
body.admin #header .header-user-menu.open > .header-user-avatar {
  background: transparent !important;
  border-color: transparent;
}

body.admin #header .header-user-menu .staff-profile-image-small {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1;
  min-width: 100%;
  min-height: 100%;
  border-radius: inherit !important;
  -webkit-clip-path: inset(0 round 999px);
  clip-path: inset(0 round 999px);
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.18);
  transform-origin: center;
}

body.admin #header .header-user-menu > .dropdown-menu {
  margin-top: 10px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #d9e5f3;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

body.admin #header .navbar-nav.navbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-right: 2px !important;
  margin-top: 0 !important;
  height: var(--topbar-height);
  padding-right: 4px;
}

body.admin #header .navbar-nav.navbar-right > li {
  float: none;
  display: flex;
  align-items: center;
  height: var(--topbar-height);
  margin: 0 !important;
}

body.admin #header .navbar-nav.navbar-right > li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-height: 38px;
  line-height: 1 !important;
  padding: 0 12px !important;
  border-radius: 10px;
}

body.admin #header .navbar-nav.navbar-right > li:not(.icon) > a {
  font-weight: 600;
  letter-spacing: 0.01em;
}

body.admin #header .navbar-nav.navbar-right > li.header-user-menu {
  margin-right: 2px !important;
}

[dir="rtl"] body.admin #header .navbar-nav.navbar-right > li.header-user-menu {
  margin-right: 0 !important;
  margin-left: 2px !important;
}

body.admin #header .hide-menu,
body.admin #header .mobile-menu-toggle {
  color: #334155 !important;
  background: transparent !important;
  border-radius: 8px;
}

body.admin #header .hide-menu:hover,
body.admin #header .hide-menu:focus,
body.admin #header .mobile-menu-toggle:hover,
body.admin #header .mobile-menu-toggle:focus {
  color: #0f172a !important;
  background: rgba(37, 99, 235, 0.12) !important;
}

body.admin #header .navbar-nav > li > a {
  color: #334155 !important;
  border-radius: 8px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

body.admin #header .navbar-nav > li > a:hover,
body.admin #header .navbar-nav > li > a:focus,
body.admin #header .navbar-nav > li.open > a {
  color: #0f172a !important;
  background: rgba(37, 99, 235, 0.12) !important;
}

body.admin #header .navbar-nav > li.icon > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  text-align: center;
}

body.admin #header .navbar-nav > li.icon > a i,
body.admin #header .navbar-nav > li.icon > a svg,
body.admin #header .mobile-icon-menu a i,
body.admin #header .mobile-icon-menu a svg {
  display: block;
  line-height: 1;
  color: #475569;
  vertical-align: middle;
}

body.admin #header .navbar-nav > li.icon > a:hover i,
body.admin #header .navbar-nav > li.icon > a:hover svg,
body.admin #header .navbar-nav > li.icon > a:focus i,
body.admin #header .navbar-nav > li.icon > a:focus svg,
body.admin #header .mobile-icon-menu a:hover i,
body.admin #header .mobile-icon-menu a:hover svg {
  color: #0f172a;
}

body.admin #header .header-timers .top-timers > span {
  margin-top: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
}

body.admin #header .notifications-icon > span {
  margin-top: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
}

body.admin #header .header-user-menu > .header-user-avatar {
  align-self: center;
}

body.admin #header .header-user-menu > .dropdown-menu > li > a {
  border-radius: 9px;
  padding: 8px 10px;
  color: #334155;
  font-weight: 600;
}

body.admin #header .header-user-menu > .dropdown-menu > li > a:hover,
body.admin #header .header-user-menu > .dropdown-menu > li > a:focus {
  background: #edf4ff;
  color: #0f172a;
}

body.admin #header .header-user-summary {
  margin-bottom: 6px;
}

body.admin #header .header-user-summary-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #2f6fec 0%, #2459c6 100%);
  color: #ffffff;
}

body.admin #header .header-user-summary-label {
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.85;
  letter-spacing: 0.02em;
}

body.admin #header .header-user-summary-name {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
}

body.admin #header .header-user-summary-divider {
  margin: 6px 0 8px !important;
  border-color: #e2eaf4 !important;
}

body.admin #header .header-quick-create > a,
body.admin #header .header-quick-create > a > span {
  margin-top: 0 !important;
}

body.admin #header .nav.navbar-nav.visible-md.visible-lg {
  display: flex;
  align-items: center;
  height: var(--topbar-height);
}

body.admin #header .nav.navbar-nav.visible-md.visible-lg > li {
  display: flex;
  align-items: center;
  height: var(--topbar-height);
}

body.admin #header .header-quick-create > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
}

body.admin #header #top_search #search_input {
  background: #ffffff !important;
  border: 1px solid #d7e4f3 !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body.admin #header #top_search #search_input::placeholder {
  color: #64748b !important;
}

body.admin #header #top_search #search_input:hover,
body.admin #header #top_search #search_input:focus {
  background: #ffffff !important;
  border-color: #7aa2d8 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

body.admin #header #top_search_button button {
  color: #64748b !important;
}

body.admin #header #top_search:focus-within #top_search_button button {
  color: #334155 !important;
}

body.admin #header #mobile-collapse {
  background: #f5f8fd;
  border-top: 1px solid #dbe5f2;
}

body.admin #header #mobile-collapse .navbar-nav > li > a {
  color: #334155 !important;
}

/* Header polish: look profesional sin cambiar paleta */
body.admin #header {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fd 100%);
  border-bottom: 1px solid #d7e2f1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.admin #header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(215, 226, 241, 0.15) 0%, rgba(167, 189, 219, 0.9) 50%, rgba(215, 226, 241, 0.15) 100%);
  pointer-events: none;
}

body.admin #header nav {
  min-height: var(--topbar-height);
  padding-left: 8px;
  padding-right: 4px;
}

body.admin #header nav > .tw-flex {
  align-items: center;
  min-height: var(--topbar-height);
  gap: 10px;
}

body.admin #header #top_search {
  margin-top: 0 !important;
  align-self: center;
}

body.admin #header #top_search #search_input {
  height: 42px;
  border-radius: 12px !important;
  border-color: #cfdaea !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

body.admin #header #top_search #search_input:hover,
body.admin #header #top_search #search_input:focus {
  border-color: #90afd8 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 8px 18px rgba(15, 23, 42, 0.1) !important;
}

body.admin #header .navbar-nav > li > a {
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

body.admin #header .navbar-nav > li.icon > a {
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.admin #header .navbar-nav > li.icon > a:hover,
body.admin #header .navbar-nav > li.icon > a:focus,
body.admin #header .navbar-nav > li.icon.open > a {
  background: #eef3fb !important;
  border-color: #d1deee;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

body.admin #header .navbar-nav.navbar-right {
  gap: 6px;
}

body.admin #header .navbar-nav.navbar-right > li.header-user-menu {
  position: relative;
}

body.admin #header .navbar-nav.navbar-right > li.header-user-menu::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 1px;
  height: 24px;
  transform: translateY(-50%);
  background: #d6e0ee;
}

[dir="rtl"] body.admin #header .navbar-nav.navbar-right > li.header-user-menu::before {
  left: auto;
  right: -8px;
}

body.admin #header .navbar-nav.navbar-right > li:not(.icon):not(.header-user-menu) > a {
  border-radius: 10px;
  border-color: #d7e4f3;
  background: rgba(255, 255, 255, 0.75);
}

body.admin #header .navbar-nav.navbar-right > li:not(.icon):not(.header-user-menu) > a:hover,
body.admin #header .navbar-nav.navbar-right > li:not(.icon):not(.header-user-menu) > a:focus {
  background: #edf3fb !important;
  border-color: #c6d7ec;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

body.admin #header .header-quick-create > a > span {
  height: 34px;
  width: 34px;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.admin #header .header-user-menu > .header-user-avatar {
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
}

body.admin #header #mobile-collapse .navbar-nav > li > a:hover,
body.admin #header #mobile-collapse .navbar-nav > li > a:focus {
  color: #0f172a !important;
  background: rgba(37, 99, 235, 0.12) !important;
}

body.admin #wrapper {
  /* Evita que el contenido quede debajo del header fijo. */
  padding-top: var(--topbar-height);
}

body.admin #menu.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: 230px;
  height: calc(100vh - var(--topbar-height)) !important;
  max-height: calc(100vh - var(--topbar-height)) !important;
  min-height: 0 !important;
  bottom: auto !important;
  display: flex;
  flex-direction: column;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 98;
  padding-bottom: var(--sidebar-bottom-safe) !important;
  scroll-padding-bottom: var(--sidebar-bottom-safe);
}

body.admin #menu.sidebar::after {
  content: "";
  display: block;
  height: 0;
}

body.admin #setup-menu-wrapper {
  /* Menú de configuración: mismo comportamiento que el sidebar. */
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: 230px;
  height: calc(100vh - var(--topbar-height)) !important;
  max-height: calc(100vh - var(--topbar-height)) !important;
  min-height: 0 !important;
  bottom: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 100;
  padding-bottom: var(--sidebar-bottom-safe) !important;
  scroll-padding-bottom: var(--sidebar-bottom-safe);
}

body.admin #menu.sidebar #side-menu {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: var(--sidebar-bottom-safe) !important;
}

body.admin #menu.sidebar #side-menu::after {
  content: "";
  display: block;
  height: var(--sidebar-bottom-safe);
}

body.admin #setup-menu {
  padding-bottom: var(--sidebar-bottom-safe) !important;
}

body.admin #setup-menu::after {
  content: "";
  display: block;
  height: var(--sidebar-bottom-safe);
}

body.admin #menu.sidebar .slimScrollDiv {
  /* Neutraliza alturas inline que bloquean el scroll. */
  height: auto !important;
  overflow: visible !important;
}

body.admin #menu.sidebar .slimScrollDiv > #side-menu {
  height: auto !important;
  overflow: visible !important;
}

body.admin #menu.sidebar .sidebar-user-profile {
  margin-top: 12px !important;
}

/* Dashboard frame spacing: shared by view + builder. */
:root {
  --dash-pad-inline: clamp(8px, 1.2vw, 20px);
  --dash-pad-top: clamp(8px, 1vw, 16px);
  --dash-pad-bottom: clamp(10px, 1.2vw, 20px);
}

/* Unifica el espacio entre sidebar y contenido en todo el admin
   para que coincida con el dashboard de MA. */
body.admin #wrapper .content,
body.admin .content,
body.admin #content,
body.admin .content-wrapper,
body.admin #wrapper .content {
  padding-left: 0 !important;
  padding-right: var(--dash-pad-inline) !important;
  padding-top: var(--dash-pad-top) !important;
  padding-bottom: var(--dash-pad-bottom) !important;
}

@media (min-width: 769px) {
  body.admin.hide-sidebar:not(.show-sidebar) #wrapper .content,
  body.admin.hide-sidebar:not(.show-sidebar) .content,
  body.admin.hide-sidebar:not(.show-sidebar) #content,
  body.admin.hide-sidebar:not(.show-sidebar) .content-wrapper {
    padding-left: var(--dash-pad-inline) !important;
  }
}

body.admin .sidebar {
  padding-right: 2px !important;
}

/* Sidebar: visual profesional ejecutiva */
body.admin #menu.sidebar,
body.admin #setup-menu-wrapper {
  background: linear-gradient(180deg, #0f2238 0%, #152f4b 100%);
  border-right: 1px solid #1f3f64;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

[dir="rtl"] body.admin #menu.sidebar,
[dir="rtl"] body.admin #setup-menu-wrapper {
  border-right: 0;
  border-left: 1px solid #1f3f64;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.06);
}

body.admin #menu.sidebar .sidebar-user-profile .dropdown-toggle.profile {
  border: 1px solid #dbe3ec !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.18);
}

body.admin #menu.sidebar .sidebar-user-profile .dropdown-toggle.profile .tw-text-neutral-300,
body.admin #menu.sidebar .sidebar-user-profile .dropdown-toggle.profile .tw-text-neutral-500 {
  color: #64748b !important;
}

body.admin #menu.sidebar #side-menu {
  padding: 0 10px 24px !important;
  margin-top: 0;
  border-top: 0;
}

body.admin #menu.sidebar #side-menu > li {
  position: relative;
  border-left: 0 !important;
  margin-bottom: 5px;
}

body.admin #menu.sidebar #side-menu > li > a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #d7e3f4;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

body.admin #menu.sidebar #side-menu > li > a .menu-icon {
  float: none;
  margin: 0;
  width: 18px;
  min-width: 18px;
  font-size: 14px;
  color: #9bb2d0;
  text-align: center;
}

body.admin #menu.sidebar #side-menu > li > a .menu-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin #menu.sidebar #side-menu > li > a:hover,
body.admin #menu.sidebar #side-menu > li > a:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(173, 198, 232, 0.35);
  color: #ffffff;
  box-shadow: 0 6px 12px rgba(4, 12, 26, 0.28);
}

body.admin #menu.sidebar #side-menu > li > a:hover .menu-icon,
body.admin #menu.sidebar #side-menu > li > a:focus .menu-icon {
  color: #e2ecfb;
}

body.admin #menu.sidebar #side-menu > li.active > a,
body.admin #menu.sidebar #side-menu > li.mm-active > a {
  background: linear-gradient(180deg, #2f6fec 0%, #2459c6 100%);
  border-color: #4f84ed;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(4, 12, 26, 0.35);
  font-weight: 700;
}

body.admin #menu.sidebar #side-menu > li.active > a .menu-icon,
body.admin #menu.sidebar #side-menu > li.mm-active > a .menu-icon {
  color: #ffffff;
}

body.admin #menu.sidebar #side-menu > li.active::before,
body.admin #menu.sidebar #side-menu > li.mm-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: #60a5fa;
}

[dir="rtl"] body.admin #menu.sidebar #side-menu > li.active::before,
[dir="rtl"] body.admin #menu.sidebar #side-menu > li.mm-active::before {
  left: auto;
  right: 0;
}

body.admin #menu.sidebar #side-menu > li > a .arrow {
  color: #9bb2d0;
  float: none;
  margin-left: 4px;
  padding-top: 0;
}

body.admin #menu.sidebar #side-menu > li.active > a .arrow,
body.admin #menu.sidebar #side-menu > li.mm-active > a .arrow {
  color: #ffffff;
}

body.admin #menu.sidebar #side-menu > li > .nav-second-level {
  margin: 6px 0 10px 28px;
  padding: 6px 4px 6px 10px;
  border-left: 1px solid rgba(173, 198, 232, 0.35);
  background: rgba(6, 16, 31, 0.28);
  border-radius: 12px;
}

[dir="rtl"] body.admin #menu.sidebar #side-menu > li > .nav-second-level {
  margin: 6px 28px 10px 0;
  padding: 6px 10px 6px 4px;
  border-left: 0;
  border-right: 1px solid rgba(173, 198, 232, 0.35);
}

body.admin #menu.sidebar #side-menu > li > .nav-second-level > li > a {
  padding: 7px 10px !important;
  border-radius: 9px;
  border: 1px solid transparent !important;
  color: #c8d8ee;
  font-size: 12.4px;
  font-weight: 500;
  line-height: 1.25;
}

body.admin #menu.sidebar #side-menu > li > .nav-second-level > li > a:hover,
body.admin #menu.sidebar #side-menu > li > .nav-second-level > li > a:focus {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(173, 198, 232, 0.35) !important;
  color: #ffffff !important;
}

body.admin #menu.sidebar #side-menu > li > .nav-second-level > li.active > a {
  background: linear-gradient(180deg, #2f6fec 0%, #2459c6 100%) !important;
  border-color: #4f84ed !important;
  color: #ffffff !important;
  font-weight: 600;
}

body.admin #menu.sidebar #side-menu .badge,
body.admin #setup-menu .badge {
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  padding: 3px 7px;
}

body.admin #setup-menu > li:first-child {
  border-bottom: 1px solid rgba(173, 198, 232, 0.35);
  color: #d7e3f4;
  margin: 2px 0 8px;
  padding: 10px 12px;
  font-weight: 700;
}

body.admin #setup-menu > li > a {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 7px 11px;
  color: #d7e3f4;
  font-weight: 600;
}

body.admin #setup-menu > li > a:hover,
body.admin #setup-menu > li > a:focus,
body.admin #setup-menu > li.active > a {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(173, 198, 232, 0.35);
  color: #ffffff;
}

body.admin #menu.sidebar::-webkit-scrollbar,
body.admin #setup-menu-wrapper::-webkit-scrollbar {
  width: 8px;
}

body.admin #menu.sidebar::-webkit-scrollbar-track,
body.admin #setup-menu-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

body.admin #menu.sidebar::-webkit-scrollbar-thumb,
body.admin #setup-menu-wrapper::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
  opacity: 0;
  transition: opacity 0.2s ease 1s, background-color 0.2s ease 1s;
}

body.admin #menu.sidebar:hover::-webkit-scrollbar-thumb,
body.admin #menu.sidebar:focus-within::-webkit-scrollbar-thumb,
body.admin #setup-menu-wrapper:hover::-webkit-scrollbar-thumb,
body.admin #setup-menu-wrapper:focus-within::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.35);
  opacity: 1;
  transition-delay: 0s;
}

body.admin #menu.sidebar,
body.admin #setup-menu-wrapper {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

body.admin #menu.sidebar:hover,
body.admin #menu.sidebar:focus-within,
body.admin #setup-menu-wrapper:hover,
body.admin #setup-menu-wrapper:focus-within {
  scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

body.admin #wrapper .content > .row,
body.admin .content > .row,
body.admin #content > .row,
body.admin .content-wrapper > .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.admin #wrapper .content > .row > [class*="col-"],
body.admin .content > .row > [class*="col-"],
body.admin #content > .row > [class*="col-"],
body.admin .content-wrapper > .row > [class*="col-"] {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.admin .container,
body.admin .container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.admin .panel_s,
body.admin .panel {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Admin: mejoras visuales globales (mismo ajuste que Clientes) */
body.admin .panel_s {
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

body.admin .panel_s .panel-body {
  padding: 18px;
}

body.admin table.table thead th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
}

body.admin table.table tbody tr:hover {
  background: #f8fafc;
}

/* Perfil de cliente: evita solape del nombre con el contenido */
body.admin .customer_profile .client-profile-title {
  margin-bottom: 10px;
}

body.admin .customer_profile .client-profile-content {
  margin-top: 12px !important;
}

/* Evitar que el título del grupo (Contactos, etc.) se sobreponga */
body.admin.customer_profile .client-profile-content .customer-profile-group-heading,
body.admin .customer_profile .client-profile-content .customer-profile-group-heading {
  position: static !important;
  top: auto !important;
  left: auto !important;
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
  clear: both !important;
  display: block !important;
  width: 100% !important;
}

body.admin.customer_profile .client-profile-content,
body.admin .customer_profile .client-profile-content {
  margin-top: 16px !important;
  padding-top: 6px !important;
}

/* Perfil cliente: fijar ancho del menú de opciones y evitar cambios de tamaño */
body.admin .customer_profile .client-profile-layout {
  align-items: flex-start;
}

body.admin .customer_profile .client-profile-sidebar {
  flex: 0 0 260px;
  max-width: 260px;
  min-width: 220px;
}

body.admin .customer_profile .client-profile-layout {
  gap: 16px !important;
  column-gap: 16px !important;
  row-gap: 16px !important;
}

body.admin .customer_profile .client-profile-content {
  margin-left: 0 !important;
}

body.admin .customer_profile .client-profile-content {
  flex: 1 1 auto;
  min-width: 0;
}

body.admin .customer_profile .client-profile-layout {
  align-items: flex-start;
}

body.admin .customer_profile .client-profile-sidebar {
  margin-top: 8px;
}

body.admin .customer_profile .client-profile-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.admin .customer_profile .customer-profile-group-heading {
  margin-top: 4px !important;
}

body.admin .customer_profile .client-profile-title {
  margin-bottom: 6px !important;
}

body.admin .customer_profile .panel_s {
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

/* Perfil cliente: evitar salto de ancho al cargar tablas */
body.admin .customer_profile .client-profile-content .panel_s {
  min-height: 460px;
}

body.admin .customer_profile .client-profile-content .panel_s .panel-body {
  min-height: 420px;
}

body.admin .customer_profile .client-profile-content .dataTables_wrapper {
  min-height: 360px;
}

/* Alinear distancia entre menú lateral y contenido en todas las pestañas */
body.admin .customer_profile .client-profile-content > .panel_s {
  margin-top: 12px !important;
}

body.admin .customer_profile .customer-profile-group-heading {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  margin-top: 4px !important;
  margin-bottom: 10px !important;
}

body.admin .page-full .content {
  padding: 0;
}

@media (max-width: 768px) {
  body.admin #wrapper .content {
    padding: 15px;
  }
}

/* Tablas: evitar desbordes fuera del contenedor */
body.admin .table-responsive {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.admin .table-responsive > .table {
  width: 100% !important;
  min-width: 100%;
}

body.admin .dataTables_wrapper {
  max-width: 100%;
}

body.admin .dataTables_wrapper .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.admin .dataTables_wrapper .row > [class*="col-"] {
  padding-left: 0 !important;
  padding-right: 0 !important;
}


body.dashboard #wrapper .content,
body.dashboard-builder-settings #wrapper .content {
  padding: 0;
}

.dashboard-frame {
  width: 100%;
  max-width: 100%;
  padding-inline: var(--dash-pad-inline);
  padding-top: var(--dash-pad-top);
  padding-bottom: var(--dash-pad-bottom);
  box-sizing: border-box;
}

.dashboard-frame > .row {
  margin-left: 0;
  margin-right: 0;
}

.dashboard-frame > .row > [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}

/* === Ajustes finales Perfil cliente (tabs + título) === */
body.admin .customer_profile .panel-full-width-tabs {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.admin .customer_profile .panel-full-width-tabs .nav {
  margin-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-radius: 0 !important;
}

body.admin .customer_profile .panel-full-width-tabs .nav-tabs-horizontal {
  background: #f8fafc !important;
  border-top-left-radius: 10px !important;
  border-top-right-radius: 10px !important;
}

body.admin .customer_profile .customer-profile-group-heading {
  line-height: 1.35 !important;
  padding-top: 6px !important;
  margin-top: 0 !important;
}

/* Usar todo el ancho en Perfil (evitar columna vacía) */
body.admin .customer_profile #contact_info > .row > .col-md-8 {
  width: 100% !important;
  float: none !important;
}

/* Ajuste de tabs para que calcen con el panel */
body.admin .customer_profile .panel_s .panel-body {
  padding-top: 0 !important;
}

body.admin .customer_profile .panel-full-width-tabs {
  margin-left: -24px !important;
  margin-right: -24px !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  border-top-left-radius: 14px !important;
  border-top-right-radius: 14px !important;
}

body.admin .customer_profile .panel-full-width-tabs .nav {
  border-top-left-radius: 14px !important;
  border-top-right-radius: 14px !important;
}

body.admin .customer_profile .tab-content {
  padding-top: 16px !important;
}

body.admin .customer_profile .customer-profile-group-heading {
  padding-top: 10px !important;
  line-height: 1.4 !important;
}

/* Tabs del perfil: bordes cuadrados y alineado al borde del panel */
body.admin .customer_profile .panel-full-width-tabs {
  margin-left: -24px !important;
  margin-right: -24px !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

body.admin .customer_profile .panel-full-width-tabs .nav,
body.admin .customer_profile .panel-full-width-tabs .nav-tabs-horizontal {
  border-radius: 0 !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #f8fafc !important;
}

body.admin .customer_profile .panel-full-width-tabs .nav-tabs-horizontal > li > a {
  padding: 6px 12px !important;
  line-height: 1.2 !important;
}

/* Prospectos: rediseño visual profesional solo para esta tabla */
body.admin #leads_wrapper {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 220px);
}

/* Filtros de tablas: dropdown por encima del thead sticky en todo el proyecto */
._buttons,
.dt-buttons,
.p_buttons,
[id$="_wrapper"] .dataTables_filter {
  position: relative;
  z-index: 40;
}

app-filters,
.app-menu__filters,
._buttons app-filters,
._buttons .app-menu__filters {
  position: relative;
  z-index: 45;
}

app-filters .dropdown-menu,
.app-menu__filters .dropdown-menu,
._buttons app-filters .dropdown-menu,
._buttons .app-menu__filters .dropdown-menu {
  z-index: 1065 !important;
}
/* Estado abierto del filtro: forzar que quede sobre headers sticky */
app-filters .btn-group.open,
.app-menu__filters .btn-group.open,
app-filters .btn-group.open > .dropdown-menu,
.app-menu__filters .btn-group.open > .dropdown-menu {
  z-index: 1080 !important;
}

/* Filtros en modal: evitar que el selector "Agregar regla" quede detras */
.modal app-filters .dropdown-menu,
.modal .app-menu__filters .dropdown-menu,
.modal .bootstrap-select .dropdown-menu {
  z-index: 1075 !important;
}

body.admin #leads_wrapper > .row:first-child {
  display: none;
}

body.admin #leads_wrapper > .row:nth-child(2) {
  display: none;
}

body.admin #leads_wrapper > .row:nth-child(3) {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.admin #leads_wrapper > .row:nth-child(3) > [class*="col-"] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin .leads-list-panel,
body.admin .leads-list-panel-body {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.admin .leads-list-panel-body {
  padding: 0 !important;
}

body.admin #leads-table {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.admin #leads-table > .col-md-12 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.admin #leads_wrapper .dataTables_length label,
body.admin #leads_wrapper .dataTables_filter label {
  color: #475569;
  font-weight: 600;
}

body.admin .leads-length-top-slot {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 8px;
}

body.admin .leads-length-top-slot .dataTables_length {
  float: none !important;
  margin: 0 !important;
}

body.admin .leads-length-top-slot .dt-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  float: none !important;
  margin: 0 !important;
}

body.admin .leads-length-top-slot .dt-buttons .btn,
body.admin .leads-length-top-slot .dt-button {
  margin: 0 !important;
}

body.admin .leads-length-top-slot .dataTables_filter {
  float: none !important;
  margin: 0 !important;
}

body.admin .leads-length-top-slot .dataTables_filter label {
  margin: 0 !important;
}

body.admin .leads-length-top-slot .dataTables_filter .input-group {
  width: 220px;
}

body.admin .leads-length-top-slot .dataTables_length label {
  margin: 0 !important;
  color: #475569;
  font-weight: 600;
}

body.admin #leads_wrapper .dataTables_filter .input-group {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

body.admin #leads_wrapper .dataTables_filter .input-group-addon {
  border: 0;
  background: #fff;
  color: #64748b;
}

body.admin #leads_wrapper .dataTables_filter input[type="search"] {
  border: 0;
  box-shadow: none;
  height: 36px;
  color: #0f172a;
}

body.admin #leads_wrapper .dataTables_filter input[type="search"]::placeholder {
  color: #94a3b8;
}

body.admin #leads_wrapper .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin .leads-length-top-slot .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin #leads {
  width: 100% !important;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0 6px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

body.admin #leads-table .panel-table-full {
  margin: 0 !important;
}

body.admin #leads_wrapper .table-responsive {
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: transparent !important;
  box-shadow: none;
  margin-top: 0 !important;
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

body.admin #leads_wrapper > .row:last-child {
  margin-top: 8px !important;
}

body.admin #leads_wrapper .table-responsive::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.admin #leads_wrapper .table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

body.admin #leads_wrapper .table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

body.admin #leads thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #edf3fa 100%);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 12;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #dbe4ef;
}

body.admin #leads thead th + th {
  border-left: 1px solid #dfe7f3;
}

body.admin #leads tbody td {
  vertical-align: middle;
  padding: 12px 14px;
  font-size: 13px;
  border-top: 1px solid #e6edf6;
  border-bottom: 1px solid #e6edf6;
  color: #334155;
  font-weight: 500;
  background: #fff;
  line-height: 1.35;
}

body.admin #leads tbody td + td {
  border-left: 1px solid #e4ecf6;
  box-shadow: inset 1px 0 0 #f5f8fc;
}

body.admin #leads tbody tr td:first-child {
  border-left: 1px solid #e6edf6;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

body.admin #leads tbody tr td:last-child {
  border-right: 1px solid #e6edf6;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

body.admin #leads tbody tr:nth-child(even) td {
  background: #fff;
}

body.admin #leads tbody tr:hover td {
  background: #f8fbff;
  border-color: #dce7f5;
}

body.admin #leads tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 #337ab7;
}

body.admin #leads_wrapper table.dataTable {
  margin-top: 0 !important;
}

body.admin #leads .leads-cell-ellipsis {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

body.admin #leads .leads-name-cell {
  position: relative;
}

body.admin #leads .leads-name-cell a {
  display: block;
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
}

body.admin #leads .leads-name-cell a:hover {
  color: #1d4ed8;
  text-decoration: none;
}

body.admin #leads thead th:first-child,
body.admin #leads tbody td:first-child {
  width: 42px;
  text-align: center;
}

body.admin #leads thead th#th-number,
body.admin #leads tbody td:nth-child(2) {
  width: 56px;
  text-align: center;
}

body.admin #leads thead th#th-number {
  text-transform: none;
}

body.admin #leads thead th#th-number::before,
body.admin #leads thead th#th-number::after {
  display: none !important;
}

body.admin #leads thead th#th-number .dt-column-order {
  display: none !important;
}

body.admin #leads .leads-value-cell {
  display: block;
  text-align: right;
  color: #0f172a;
  font-weight: 700;
}

body.admin #leads .is-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

body.admin #leads .label {
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}

body.admin #leads .lead-product-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid transparent;
}

body.admin #leads .lead-product-chip-novafood {
  color: #b42318;
  background: rgba(255, 87, 87, 0.16);
  border-color: #ff5757;
}

body.admin #leads .lead-product-chip-crmpro {
  color: #004aad;
  background: rgba(0, 74, 173, 0.12);
  border-color: #004aad;
}

body.admin #leads .lead-product-chip-novapos {
  color: #8a5a00;
  background: rgba(255, 189, 89, 0.22);
  border-color: #ffbd59;
}

body.admin #leads .lead-product-chip-default {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

body.admin #leads .lead-source-chip {
  display: inline-flex;
  align-items: center;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
  color: #0c4a6e;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid #7dd3fc;
}

body.admin #leads .row-options {
  font-size: 11px;
  color: #64748b;
}

body.admin #leads .row-options a {
  color: #475569;
  font-weight: 500;
}

body.admin #leads .row-options a:hover {
  color: #0f172a;
  text-decoration: underline;
}

body.admin #leads .row-options a.text-danger {
  color: #dc2626 !important;
}

/* Quita indicadores de borde lateral heredados */
body.admin #leads.dataTable tbody tr.has-border-left,
body.admin #leads.dataTable tbody tr.row-border-info {
  border-left: 0 !important;
  box-shadow: none !important;
}

body.admin #leads.dataTable tbody tr.has-border-left::before,
body.admin #leads.dataTable tbody tr.row-border-info::before,
body.admin #leads.dataTable tbody tr.has-border-left::after,
body.admin #leads.dataTable tbody tr.row-border-info::after {
  display: none !important;
  content: none !important;
}

body.admin #leads.dataTable tbody tr.has-border-left > td,
body.admin #leads.dataTable tbody tr.row-border-info > td {
  border-left: 0 !important;
}

body.admin #leads_wrapper .dataTables_info {
  color: #64748b;
  font-weight: 500;
}

body.admin #leads_wrapper .dt-buttons .btn,
body.admin #leads_wrapper .dt-button {
  border: 1px solid #dbe3ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body.admin #leads_wrapper .dt-buttons .btn:hover,
body.admin #leads_wrapper .dt-button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body.admin #leads_wrapper .pagination > li > a,
body.admin #leads_wrapper .pagination > li > span {
  border: 1px solid #dbe3ee;
  color: #334155;
  margin-left: 4px;
  border-radius: 8px !important;
  background: #fff;
}

body.admin #leads_wrapper .pagination > li > a:hover,
body.admin #leads_wrapper .pagination > li > span:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.admin #leads_wrapper .pagination > .active > a,
body.admin #leads_wrapper .pagination > .active > a:focus,
body.admin #leads_wrapper .pagination > .active > a:hover,
body.admin #leads_wrapper .pagination > .active > span,
body.admin #leads_wrapper .pagination > .active > span:focus,
body.admin #leads_wrapper .pagination > .active > span:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* Propuestas: rediseño visual profesional */
body.admin #proposals_wrapper {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: calc(100vh - 190px);
  min-height: calc(100vh - 190px);
}

body.admin #proposals_wrapper > .row:first-child {
  display: none;
}

body.admin #proposals_wrapper > .row:nth-child(2) {
  display: none;
}

body.admin #proposals_wrapper > .row:nth-child(3) {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.admin #proposals_wrapper > .row:nth-child(3) > [class*="col-"] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin .proposals-list-panel,
body.admin .proposals-list-panel-body {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.admin .proposals-list-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin .proposals-list-panel-body {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin #small-table {
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin #small-table > .proposals-list-panel {
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin #proposals_wrapper .dataTables_length label,
body.admin #proposals_wrapper .dataTables_filter label {
  color: #475569;
  font-weight: 600;
}

body.admin .proposals-top-controls-slot {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 8px;
}

body.admin .proposals-top-controls-slot .dataTables_length {
  float: none !important;
  margin: 0 !important;
}

body.admin .proposals-top-controls-slot .dt-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  float: none !important;
  margin: 0 !important;
}

body.admin .proposals-top-controls-slot .dt-buttons .btn,
body.admin .proposals-top-controls-slot .dt-button {
  margin: 0 !important;
}

body.admin .proposals-top-controls-slot .dataTables_filter {
  float: none !important;
  margin: 0 !important;
}

body.admin .proposals-top-controls-slot .dataTables_filter label,
body.admin .proposals-top-controls-slot .dataTables_length label {
  margin: 0 !important;
}

body.admin .proposals-top-controls-slot .dataTables_filter .input-group {
  width: 220px;
}

body.admin #proposals_wrapper .dataTables_filter .input-group {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

body.admin #proposals_wrapper .dataTables_filter .input-group-addon {
  border: 0;
  background: #fff;
  color: #64748b;
}

body.admin #proposals_wrapper .dataTables_filter input[type="search"] {
  border: 0;
  box-shadow: none;
  height: 36px;
  color: #0f172a;
}

body.admin #proposals_wrapper .dataTables_filter input[type="search"]::placeholder {
  color: #94a3b8;
}

body.admin #proposals_wrapper .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin .proposals-top-controls-slot .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin #proposals {
  width: 100% !important;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0 6px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

body.admin #proposals_wrapper .table-responsive {
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: transparent !important;
  box-shadow: none;
  margin-top: 0 !important;
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: visible !important;
  overflow-x: auto !important;
  position: relative;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

body.admin #proposals_wrapper .table-responsive::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.admin #proposals_wrapper .table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

body.admin #proposals_wrapper .table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

body.admin #proposals_wrapper table.dataTable {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.admin #proposals thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #edf3fa 100%);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 12;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #dbe4ef;
}

body.admin #proposals thead th + th {
  border-left: 1px solid #e4ecf6;
}

body.admin #proposals tbody td {
  vertical-align: middle;
  padding: 12px 14px;
  font-size: 13px;
  border-top: 1px solid #e6edf6;
  border-bottom: 1px solid #e6edf6;
  color: #334155;
  font-weight: 500;
  background: #fff;
  line-height: 1.35;
  white-space: nowrap;
}

body.admin #proposals tbody td + td {
  border-left: 1px solid #f0f4fa;
}

body.admin #proposals tbody tr td:first-child {
  border-left: 1px solid #e6edf6;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

body.admin #proposals tbody tr td:last-child {
  border-right: 1px solid #e6edf6;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

body.admin #proposals tbody tr:nth-child(even) td {
  background: #fff;
}

body.admin #proposals tbody tr:hover td {
  background: #f8fbff;
  border-color: #dce7f5;
}

body.admin #proposals tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 #337ab7;
}

body.admin #proposals thead th:first-child,
body.admin #proposals tbody td:first-child {
  width: 170px;
}

body.admin #proposals .proposal-number-link {
  color: #0f172a;
  text-decoration: none;
}

body.admin #proposals .proposal-number-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}

body.admin #proposals .proposal-cell-ellipsis {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

body.admin #proposals a.proposal-cell-ellipsis {
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
}

body.admin #proposals a.proposal-cell-ellipsis:hover {
  color: #1d4ed8;
}

body.admin #proposals .proposal-value-cell {
  display: block;
  text-align: right;
  color: #0f172a;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.admin #proposals .proposal-date-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

body.admin #proposals .proposal-inline-note {
  white-space: nowrap;
  vertical-align: middle;
}

body.admin #proposals .proposal-tags-cell .label {
  margin-bottom: 2px;
}

body.admin #proposals .proposal-tags-cell {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

body.admin #proposals .label {
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  white-space: nowrap;
}

body.admin #proposals .row-options {
  font-size: 12px;
  color: #64748b;
}

body.admin #proposals .row-options a {
  color: #475569;
  font-weight: 500;
}

body.admin #proposals .row-options a:hover {
  color: #0f172a;
  text-decoration: underline;
}

body.admin #proposals .row-options a.text-danger {
  color: #dc2626 !important;
}

body.admin #proposals_wrapper .dataTables_info {
  color: #64748b;
  font-weight: 500;
}

body.admin #proposals_wrapper .dt-buttons .btn,
body.admin #proposals_wrapper .dt-button {
  border: 1px solid #dbe3ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body.admin #proposals_wrapper .dt-buttons .btn:hover,
body.admin #proposals_wrapper .dt-button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body.admin #proposals_wrapper .pagination > li > a,
body.admin #proposals_wrapper .pagination > li > span {
  border: 1px solid #dbe3ee;
  color: #334155;
  margin-left: 4px;
  border-radius: 8px !important;
  background: #fff;
}

body.admin #proposals_wrapper .pagination > li > a:hover,
body.admin #proposals_wrapper .pagination > li > span:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.admin #proposals_wrapper .pagination > .active > a,
body.admin #proposals_wrapper .pagination > .active > a:focus,
body.admin #proposals_wrapper .pagination > .active > a:hover,
body.admin #proposals_wrapper .pagination > .active > span,
body.admin #proposals_wrapper .pagination > .active > span:focus,
body.admin #proposals_wrapper .pagination > .active > span:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

body.admin #proposals_wrapper > .row:last-child {
  margin-top: auto !important;
  padding-top: 8px;
}

/* Clientes: replicar visual de Prospectos */
body.admin #clients_wrapper {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 220px);
}

body.admin #clients_wrapper > .row:first-child {
  display: none;
}

body.admin #clients_wrapper > .row:nth-child(2) {
  display: none;
}

body.admin #clients_wrapper > .row:nth-child(3) {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.admin #clients_wrapper > .row:nth-child(3) > [class*="col-"] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin .clients-list-panel,
body.admin .clients-list-panel-body {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.admin .clients-list-panel-body {
  padding: 0 !important;
}

body.admin #clients_wrapper .panel-table-full {
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin #clients_wrapper .dataTables_length label,
body.admin #clients_wrapper .dataTables_filter label {
  color: #475569;
  font-weight: 600;
}

body.admin .clients-length-top-slot {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 8px;
}

body.admin .clients-length-top-slot .dataTables_length {
  float: none !important;
  margin: 0 !important;
}

body.admin .clients-length-top-slot .dt-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  float: none !important;
  margin: 0 !important;
}

body.admin .clients-length-top-slot .dt-buttons .btn,
body.admin .clients-length-top-slot .dt-button {
  margin: 0 !important;
}

body.admin .clients-length-top-slot .dataTables_filter {
  float: none !important;
  margin: 0 !important;
}

body.admin .clients-length-top-slot .dataTables_filter label,
body.admin .clients-length-top-slot .dataTables_length label {
  margin: 0 !important;
}

body.admin .clients-length-top-slot .dataTables_filter .input-group {
  width: 220px;
}

body.admin #clients_wrapper .dataTables_filter .input-group {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

body.admin #clients_wrapper .dataTables_filter .input-group-addon {
  border: 0;
  background: #fff;
  color: #64748b;
}

body.admin #clients_wrapper .dataTables_filter input[type="search"] {
  border: 0;
  box-shadow: none;
  height: 36px;
  color: #0f172a;
}

body.admin #clients_wrapper .dataTables_filter input[type="search"]::placeholder {
  color: #94a3b8;
}

body.admin #clients_wrapper .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin .clients-length-top-slot .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin #clients {
  width: 100% !important;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0 6px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

body.admin #clients_wrapper .table-responsive {
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: transparent !important;
  box-shadow: none;
  margin-top: 0 !important;
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

body.admin #clients_wrapper .table-responsive::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.admin #clients_wrapper .table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

body.admin #clients_wrapper .table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

body.admin #clients_wrapper table.dataTable {
  margin-top: 0 !important;
}

body.admin #clients thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #edf3fa 100%);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 12;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #dbe4ef;
}

body.admin #clients thead th + th {
  border-left: 1px solid #dfe7f3;
}

body.admin #clients tbody td {
  vertical-align: middle;
  padding: 12px 14px;
  font-size: 13px;
  border-top: 1px solid #e6edf6;
  border-bottom: 1px solid #e6edf6;
  color: #334155;
  font-weight: 500;
  background: #fff;
  line-height: 1.35;
}

body.admin #clients tbody td + td {
  border-left: 1px solid #e4ecf6;
  box-shadow: inset 1px 0 0 #f5f8fc;
}

body.admin #clients tbody tr td:first-child {
  border-left: 1px solid #e6edf6;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  width: 42px;
  text-align: center;
}

body.admin #clients tbody tr td:last-child {
  border-right: 1px solid #e6edf6;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

body.admin #clients thead th:first-child {
  width: 42px;
  text-align: center;
}

body.admin #clients thead th#th-number,
body.admin #clients tbody td:nth-child(2) {
  width: 84px;
  text-align: center;
  white-space: nowrap;
}

body.admin #clients tbody tr:nth-child(even) td {
  background: #fff;
}

body.admin #clients tbody tr:hover td {
  background: #f8fbff;
  border-color: #dce7f5;
}

body.admin #clients tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 #337ab7;
}

body.admin #clients tbody td:nth-child(3) > a,
body.admin #clients tbody td:nth-child(4) > a,
body.admin #clients tbody td:nth-child(5) > a,
body.admin #clients tbody td:nth-child(6) > a {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

body.admin #clients tbody td:nth-child(9) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

body.admin #clients .row-options {
  font-size: 11px;
  color: #64748b;
}

body.admin #clients .row-options a {
  color: #475569;
  font-weight: 500;
}

body.admin #clients .row-options a:hover {
  color: #0f172a;
  text-decoration: underline;
}

body.admin #clients .row-options a._delete,
body.admin #clients .row-options a.text-danger {
  color: #dc2626 !important;
}

body.admin #clients .customer-group-list,
body.admin #clients .label {
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}

body.admin #clients.dataTable tbody tr.has-border-left,
body.admin #clients.dataTable tbody tr.row-border-warning,
body.admin #clients.dataTable tbody tr.row-border-info {
  border-left: 0 !important;
  box-shadow: none !important;
}

body.admin #clients.dataTable tbody tr.has-border-left::before,
body.admin #clients.dataTable tbody tr.row-border-warning::before,
body.admin #clients.dataTable tbody tr.row-border-info::before,
body.admin #clients.dataTable tbody tr.has-border-left::after,
body.admin #clients.dataTable tbody tr.row-border-warning::after,
body.admin #clients.dataTable tbody tr.row-border-info::after {
  display: none !important;
  content: none !important;
}

body.admin #clients.dataTable tbody tr.has-border-left > td,
body.admin #clients.dataTable tbody tr.row-border-warning > td,
body.admin #clients.dataTable tbody tr.row-border-info > td {
  border-left: 0 !important;
}

body.admin #clients_wrapper .dataTables_info {
  color: #64748b;
  font-weight: 500;
}

body.admin #clients_wrapper .dt-buttons .btn,
body.admin #clients_wrapper .dt-button {
  border: 1px solid #dbe3ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body.admin #clients_wrapper .dt-buttons .btn:hover,
body.admin #clients_wrapper .dt-button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body.admin #clients_wrapper .pagination > li > a,
body.admin #clients_wrapper .pagination > li > span {
  border: 1px solid #dbe3ee;
  color: #334155;
  margin-left: 4px;
  border-radius: 8px !important;
  background: #fff;
}

body.admin #clients_wrapper .pagination > li > a:hover,
body.admin #clients_wrapper .pagination > li > span:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.admin #clients_wrapper .pagination > .active > a,
body.admin #clients_wrapper .pagination > .active > a:focus,
body.admin #clients_wrapper .pagination > .active > a:hover,
body.admin #clients_wrapper .pagination > .active > span,
body.admin #clients_wrapper .pagination > .active > span:focus,
body.admin #clients_wrapper .pagination > .active > span:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

body.admin #clients_wrapper > .row:last-child {
  margin-top: 8px !important;
}

/* Facturas: replicar visual de Prospectos */
body.admin .invoices-list-view #invoices_wrapper {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 220px);
}

body.admin .invoices-list-view #invoices_wrapper > .row:first-child {
  display: none;
}

body.admin .invoices-list-view #invoices_wrapper > .row:nth-child(2) {
  display: none;
}

body.admin .invoices-list-view #invoices_wrapper > .row:nth-child(3) {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.admin .invoices-list-view #invoices_wrapper > .row:nth-child(3) > [class*="col-"] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin .invoices-list-view .invoices-list-panel,
body.admin .invoices-list-view .invoices-list-panel-body {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.admin .invoices-list-view .invoices-list-panel-body {
  padding: 0 !important;
}

body.admin .invoices-list-view #invoices_wrapper .panel-table-full {
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.admin .invoices-list-view #invoices_wrapper .dataTables_length label,
body.admin .invoices-list-view #invoices_wrapper .dataTables_filter label {
  color: #475569;
  font-weight: 600;
}

body.admin .invoices-list-view .invoices-top-controls-slot {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 8px;
}

body.admin .invoices-list-view .invoices-top-controls-slot .dataTables_length {
  float: none !important;
  margin: 0 !important;
}

body.admin .invoices-list-view .invoices-top-controls-slot .dt-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  float: none !important;
  margin: 0 !important;
}

body.admin .invoices-list-view .invoices-top-controls-slot .dt-buttons .btn,
body.admin .invoices-list-view .invoices-top-controls-slot .dt-button {
  margin: 0 !important;
}

body.admin .invoices-list-view .invoices-top-controls-slot .dataTables_filter {
  float: none !important;
  margin: 0 !important;
}

body.admin .invoices-list-view .invoices-top-controls-slot .dataTables_filter label,
body.admin .invoices-list-view .invoices-top-controls-slot .dataTables_length label {
  margin: 0 !important;
}

body.admin .invoices-list-view .invoices-top-controls-slot .dataTables_filter .input-group {
  width: 220px;
}

body.admin .invoices-list-view #invoices_wrapper .dataTables_filter .input-group {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

body.admin .invoices-list-view #invoices_wrapper .dataTables_filter .input-group-addon {
  border: 0;
  background: #fff;
  color: #64748b;
}

body.admin .invoices-list-view #invoices_wrapper .dataTables_filter input[type="search"] {
  border: 0;
  box-shadow: none;
  height: 36px;
  color: #0f172a;
}

body.admin .invoices-list-view #invoices_wrapper .dataTables_filter input[type="search"]::placeholder {
  color: #94a3b8;
}

body.admin .invoices-list-view #invoices_wrapper .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin .invoices-list-view .invoices-top-controls-slot .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin .invoices-list-view #invoices {
  width: 100% !important;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0 6px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

body.admin .invoices-list-view #invoices_wrapper .table-responsive {
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: transparent !important;
  box-shadow: none;
  margin-top: 0 !important;
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

body.admin .invoices-list-view #invoices_wrapper .table-responsive::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.admin .invoices-list-view #invoices_wrapper .table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

body.admin .invoices-list-view #invoices_wrapper .table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

body.admin .invoices-list-view #invoices_wrapper table.dataTable {
  margin-top: 0 !important;
}

body.admin .invoices-list-view #invoices thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #edf3fa 100%);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 12;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #dbe4ef;
}

body.admin .invoices-list-view #invoices thead th + th {
  border-left: 1px solid #dfe7f3;
}

body.admin .invoices-list-view #invoices tbody td {
  vertical-align: middle;
  padding: 12px 14px;
  font-size: 13px;
  border-top: 1px solid #e6edf6;
  border-bottom: 1px solid #e6edf6;
  color: #334155;
  font-weight: 500;
  background: #fff;
  line-height: 1.35;
  white-space: nowrap;
}

body.admin .invoices-list-view #invoices tbody td + td {
  border-left: 1px solid #e4ecf6;
  box-shadow: inset 1px 0 0 #f5f8fc;
}

body.admin .invoices-list-view #invoices tbody tr td:first-child {
  border-left: 1px solid #e6edf6;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

body.admin .invoices-list-view #invoices thead th:first-child,
body.admin .invoices-list-view #invoices tbody td:first-child {
  display: none;
}

body.admin .invoices-list-view #invoices tbody tr td:nth-child(2) {
  border-left: 1px solid #e6edf6;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

body.admin .invoices-list-view #invoices tbody tr td:last-child {
  border-right: 1px solid #e6edf6;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

body.admin .invoices-list-view #invoices tbody tr:nth-child(even) td {
  background: #fff;
}

body.admin .invoices-list-view #invoices tbody tr:hover td {
  background: #f8fbff;
  border-color: #dce7f5;
}

body.admin .invoices-list-view #invoices tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 #337ab7;
}

body.admin .invoices-list-view #invoices tbody tr:hover td:nth-child(2) {
  box-shadow: inset 3px 0 0 #337ab7;
}

body.admin .invoices-list-view #invoices tbody td:nth-child(1) > a,
body.admin .invoices-list-view #invoices tbody td:nth-child(6) > a,
body.admin .invoices-list-view #invoices tbody td:nth-child(7) > a {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

body.admin .invoices-list-view #invoices .label {
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  white-space: nowrap;
}

body.admin .invoices-list-view #invoices .row-options {
  font-size: 11px;
  color: #64748b;
}

body.admin .invoices-list-view #invoices .row-options a {
  color: #475569;
  font-weight: 500;
}

body.admin .invoices-list-view #invoices .row-options a:hover {
  color: #0f172a;
  text-decoration: underline;
}

body.admin .invoices-list-view #invoices .row-options a._delete,
body.admin .invoices-list-view #invoices .row-options a.text-danger {
  color: #dc2626 !important;
}

body.admin .invoices-list-view #invoices_wrapper .dataTables_info {
  color: #64748b;
  font-weight: 500;
}

body.admin .invoices-list-view #invoices_wrapper .dt-buttons .btn,
body.admin .invoices-list-view #invoices_wrapper .dt-button {
  border: 1px solid #dbe3ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body.admin .invoices-list-view #invoices_wrapper .dt-buttons .btn:hover,
body.admin .invoices-list-view #invoices_wrapper .dt-button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body.admin .invoices-list-view #invoices_wrapper .pagination > li > a,
body.admin .invoices-list-view #invoices_wrapper .pagination > li > span {
  border: 1px solid #dbe3ee;
  color: #334155;
  margin-left: 4px;
  border-radius: 8px !important;
  background: #fff;
}

body.admin .invoices-list-view #invoices_wrapper .pagination > li > a:hover,
body.admin .invoices-list-view #invoices_wrapper .pagination > li > span:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.admin .invoices-list-view #invoices_wrapper .pagination > .active > a,
body.admin .invoices-list-view #invoices_wrapper .pagination > .active > a:focus,
body.admin .invoices-list-view #invoices_wrapper .pagination > .active > a:hover,
body.admin .invoices-list-view #invoices_wrapper .pagination > .active > span,
body.admin .invoices-list-view #invoices_wrapper .pagination > .active > span:focus,
body.admin .invoices-list-view #invoices_wrapper .pagination > .active > span:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

body.admin .invoices-list-view #invoices_wrapper > .row:last-child {
  margin-top: 8px !important;
}

@media (max-width: 992px) {
  body.admin #leads {
    min-width: 980px;
  }

  body.admin #leads thead th,
  body.admin #leads tbody td {
    padding: 10px 10px;
  }

  body.admin #leads .leads-cell-ellipsis {
    max-width: 170px;
  }

  body.admin #proposals {
    min-width: 980px;
  }

  body.admin #proposals thead th,
  body.admin #proposals tbody td {
    padding: 10px 10px;
  }

  body.admin #proposals .proposal-cell-ellipsis {
    max-width: 180px;
  }

  body.admin #clients {
    min-width: 980px;
  }

  body.admin #clients thead th,
  body.admin #clients tbody td {
    padding: 10px 10px;
  }

  body.admin .invoices-list-view #invoices {
    min-width: 980px;
  }

  body.admin .invoices-list-view #invoices thead th,
  body.admin .invoices-list-view #invoices tbody td {
    padding: 10px 10px;
  }
}

@media (max-width: 768px) {
  body.admin #menu.sidebar {
    position: fixed;
  }
}

/* Lead modal: full screen + layout 3 columnas */
#lead-modal.lead-detail-fullscreen,
.lead-detail-fullscreen#lead-modal,
.lead-detail-fullscreen {
  padding: 0 !important;
}

.lead-detail-fullscreen .modal-dialog {
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

.lead-detail-fullscreen .modal-content {
  height: 100vh !important;
  border-radius: 0 !important;
  display: flex;
  flex-direction: column;
}

.lead-detail-fullscreen .modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}

.lead-detail-fullscreen .modal-body,
.lead-detail-fullscreen .modal-body.lead-modal-body {
  height: calc(100vh - 60px) !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.lead-detail-fullscreen .lead-3col-wrap {
  display: flex;
  height: 100%;
  width: 100%;
}

.lead-detail-fullscreen .lead-col-left,
.lead-detail-fullscreen .lead-col-center,
.lead-detail-fullscreen .lead-col-right {
  min-width: 0;
  min-height: 0;
}

.lead-detail-fullscreen .lead-col-left {
  flex: 0 0 320px;
  border-right: 1px solid #eee;
  overflow: auto;
  padding: 15px;
}

.lead-detail-fullscreen .lead-col-center {
  flex: 1 1 auto;
  border-right: 1px solid #eee;
  overflow: auto;
  padding: 15px;
}

.lead-detail-fullscreen .lead-col-right {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 15px;
}

.lead-detail-fullscreen .lead-right-tabs-nav {
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.lead-detail-fullscreen .lead-right-tab-content {
  margin-top: 10px;
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
}

@media (max-width: 991px) {
  .lead-detail-fullscreen .lead-3col-wrap {
    flex-direction: column;
  }
  .lead-detail-fullscreen .lead-col-left,
  .lead-detail-fullscreen .lead-col-center,
  .lead-detail-fullscreen .lead-col-right {
    flex: 1 1 auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #eee;
  }
}

/* Global Highcharts polish (from MA) */
.highcharts-fullscreen,
.highcharts-fullscreen .highcharts-container,
.highcharts-fullscreen .highcharts-root,
.highcharts-fullscreen .highcharts-background {
  background: #ffffff !important;
  fill: #ffffff !important;
}

.highcharts-fullscreen:-webkit-full-screen,
.highcharts-fullscreen:fullscreen,
.highcharts-fullscreen:-ms-fullscreen,
.highcharts-fullscreen:-moz-full-screen {
  background: #ffffff !important;
}

.highcharts-fullscreen:-webkit-full-screen .highcharts-container,
.highcharts-fullscreen:fullscreen .highcharts-container,
.highcharts-fullscreen:-ms-fullscreen .highcharts-container,
.highcharts-fullscreen:-moz-full-screen .highcharts-container,
.highcharts-fullscreen:-webkit-full-screen .highcharts-root,
.highcharts-fullscreen:fullscreen .highcharts-root,
.highcharts-fullscreen:-ms-fullscreen .highcharts-root,
.highcharts-fullscreen:-moz-full-screen .highcharts-root,
.highcharts-fullscreen:-webkit-full-screen .highcharts-background,
.highcharts-fullscreen:fullscreen .highcharts-background,
.highcharts-fullscreen:-ms-fullscreen .highcharts-background,
.highcharts-fullscreen:-moz-full-screen .highcharts-background {
  background: #ffffff !important;
  fill: #ffffff !important;
}

*:-webkit-full-screen {
  background: #ffffff !important;
}
*:fullscreen {
  background: #ffffff !important;
}
*:-ms-fullscreen {
  background: #ffffff !important;
}
*:-moz-full-screen {
  background: #ffffff !important;
}

*:-webkit-full-screen .highcharts-background,
*:fullscreen .highcharts-background,
*:-ms-fullscreen .highcharts-background,
*:-moz-full-screen .highcharts-background {
  fill: #ffffff !important;
}

.highcharts-root .highcharts-background {
  fill: #ffffff !important;
}

html:fullscreen,
body:fullscreen,
html:-webkit-full-screen,
body:-webkit-full-screen,
html:-moz-full-screen,
body:-moz-full-screen,
html:-ms-fullscreen,
body:-ms-fullscreen {
  background: #ffffff !important;
}

.highcharts-contextbutton {
  background: #ffffff !important;
  border: 1px solid #e4e9f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12) !important;
}
.highcharts-contextbutton .highcharts-button-symbol {
  stroke: #475569 !important;
}
.highcharts-contextmenu {
  border-radius: 18px !important;
  border: none !important;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18) !important;
  padding: 8px !important;
  margin-top: 12px !important;
  right: 12px !important;
  left: auto !important;
  z-index: 1000 !important;
  background: #ffffff !important;
  overflow: hidden !important;
}
.highcharts-contextmenu .highcharts-menu,
.highcharts-contextmenu > div {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.highcharts-contextmenu hr {
  margin: 6px 10px !important;
  border-color: #eef2f7 !important;
}
.highcharts-contextmenu a {
  border-radius: 8px !important;
  padding: 8px 12px !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.highcharts-contextmenu a:hover {
  background: #eef2ff !important;
  color: #0f172a !important;
}
.highcharts-contextmenu a:first-child {
  border-radius: 12px !important;
  background: #2563eb !important;
  color: #ffffff !important;
}
.highcharts-contextmenu a:first-child:hover {
  background: #1d4ed8 !important;
}
.highcharts-contextmenu a:first-child::before {
  color: #ffffff !important;
}
.highcharts-contextmenu a:first-child::before {
  content: "\\f0b2";
  font-family: "FontAwesome";
}
.highcharts-contextmenu a:nth-child(2)::before {
  content: "\\f02f";
  font-family: "FontAwesome";
}
.highcharts-contextmenu a:nth-child(4)::before {
  content: "\\f1c5";
  font-family: "FontAwesome";
}
.highcharts-contextmenu a:nth-child(5)::before {
  content: "\\f1c5";
  font-family: "FontAwesome";
}
.highcharts-contextmenu a:nth-child(6)::before {
  content: "\\f1c1";
  font-family: "FontAwesome";
}
.highcharts-contextmenu a:nth-child(7)::before {
  content: "\\f1c8";
  font-family: "FontAwesome";
}

/* Highcharts: keep charts inside their containers */
.highcharts-container {
  max-width: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
.highcharts-root,
.highcharts-container svg {
  max-width: 100% !important;
}

/* Responsive hardening: mantener visual pro en telefonos/tablets/iPad */
@media (max-width: 1200px) {
  body.admin #header nav {
    padding-left: 6px;
    padding-right: 2px;
  }

  body.admin #header #top_search {
    max-width: clamp(220px, 34vw, 360px);
    margin-left: 6px;
    margin-right: 6px;
  }

  body.admin #header #top_search #search_input {
    width: 100% !important;
  }

  body.admin #header .navbar-nav.navbar-right {
    gap: 4px;
  }

  body.admin #header .navbar-nav.navbar-right > li > a {
    height: 36px;
    min-height: 36px;
    padding: 0 10px !important;
  }

  body.admin #header .navbar-nav > li.icon > a {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }
}

@media (max-width: 992px) {
  body.admin #header #top_search {
    max-width: clamp(190px, 32vw, 300px);
  }

  body.admin #header .navbar-nav.navbar-right > li:not(.icon):not(.header-user-menu) {
    display: none !important;
  }

  body.admin #header .navbar-nav.navbar-right > li.header-user-menu::before {
    display: none;
  }

  body.admin #header .header-user-menu > .header-user-avatar {
    width: 44px;
    height: 44px;
  }

  body.admin #leads_wrapper,
  body.admin #proposals_wrapper,
  body.admin #clients_wrapper,
  body.admin .invoices-list-view #invoices_wrapper {
    height: auto !important;
    min-height: 0 !important;
  }

  body.admin #leads_wrapper .table-responsive,
  body.admin #proposals_wrapper .table-responsive,
  body.admin #clients_wrapper .table-responsive,
  body.admin .invoices-list-view #invoices_wrapper .table-responsive {
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: auto !important;
  }

  body.admin #leads,
  body.admin #proposals,
  body.admin #clients,
  body.admin .invoices-list-view #invoices {
    min-width: 980px;
  }

  body.admin #leads thead th,
  body.admin #proposals thead th,
  body.admin #clients thead th,
  body.admin .invoices-list-view #invoices thead th {
    position: static;
  }

  body.admin .leads-length-top-slot,
  body.admin .proposals-top-controls-slot,
  body.admin .clients-length-top-slot,
  body.admin .invoices-top-controls-slot {
    display: flex;
    width: 100%;
    margin-left: 0;
    gap: 8px;
  }

  body.admin .leads-length-top-slot .dataTables_filter .input-group,
  body.admin .proposals-top-controls-slot .dataTables_filter .input-group,
  body.admin .clients-length-top-slot .dataTables_filter .input-group,
  body.admin .invoices-top-controls-slot .dataTables_filter .input-group {
    width: min(100%, 260px);
  }
}

@media (max-width: 768px) {
  :root {
    --topbar-height: 60px;
  }

  body.admin #header nav {
    padding-left: 6px;
    padding-right: 4px;
  }

  body.admin #header #logo .logo img {
    max-height: 32px;
    width: auto;
  }

  body.admin #header #top_search {
    max-width: min(52vw, 250px);
    margin-left: 4px;
    margin-right: 4px;
  }

  body.admin #header #top_search #search_input {
    height: 38px;
    border-radius: 10px !important;
    font-size: 14px;
  }

  body.admin #header .mobile-menu .mobile-icon-menu {
    display: none !important;
  }

  body.admin #header .navbar-nav.navbar-right {
    display: flex !important;
    gap: 4px;
    margin-right: 0 !important;
    padding-right: 0;
  }

  body.admin #header .navbar-nav.navbar-right > li {
    display: none !important;
    height: var(--topbar-height);
  }

  body.admin #header .navbar-nav.navbar-right > li.header-notifications,
  body.admin #header .navbar-nav.navbar-right > li.header-user-menu {
    display: flex !important;
  }

  body.admin #header .header-user-menu > .header-user-avatar {
    width: 40px;
    height: 40px;
    border-width: 2px;
  }

  body.admin #menu.sidebar,
  body.admin #setup-menu-wrapper {
    width: min(86vw, 300px) !important;
  }

  body.admin #leads,
  body.admin #proposals,
  body.admin #clients,
  body.admin .invoices-list-view #invoices {
    min-width: 900px;
  }

  body.admin #leads thead th,
  body.admin #leads tbody td,
  body.admin #proposals thead th,
  body.admin #proposals tbody td,
  body.admin #clients thead th,
  body.admin #clients tbody td,
  body.admin .invoices-list-view #invoices thead th,
  body.admin .invoices-list-view #invoices tbody td {
    padding: 10px 10px;
    font-size: 12px;
  }

  body.admin .leads-length-top-slot,
  body.admin .proposals-top-controls-slot,
  body.admin .clients-length-top-slot,
  body.admin .invoices-top-controls-slot {
    gap: 6px;
  }

  body.admin .leads-length-top-slot .dataTables_filter,
  body.admin .proposals-top-controls-slot .dataTables_filter,
  body.admin .clients-length-top-slot .dataTables_filter,
  body.admin .invoices-top-controls-slot .dataTables_filter {
    width: 100%;
  }

  body.admin .leads-length-top-slot .dataTables_filter .input-group,
  body.admin .proposals-top-controls-slot .dataTables_filter .input-group,
  body.admin .clients-length-top-slot .dataTables_filter .input-group,
  body.admin .invoices-top-controls-slot .dataTables_filter .input-group {
    width: 100%;
  }

  body.admin #leads_wrapper > .row:last-child,
  body.admin #proposals_wrapper > .row:last-child,
  body.admin #clients_wrapper > .row:last-child,
  body.admin .invoices-list-view #invoices_wrapper > .row:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  body.admin #leads_wrapper .dataTables_info,
  body.admin #proposals_wrapper .dataTables_info,
  body.admin #clients_wrapper .dataTables_info,
  body.admin .invoices-list-view #invoices_wrapper .dataTables_info {
    width: 100%;
    margin-bottom: 4px;
  }

  body.admin #leads_wrapper .dataTables_paginate,
  body.admin #proposals_wrapper .dataTables_paginate,
  body.admin #clients_wrapper .dataTables_paginate,
  body.admin .invoices-list-view #invoices_wrapper .dataTables_paginate {
    width: 100%;
    text-align: left !important;
  }
}

/* =========================================================
   Calibracion responsive global (iPhone / iPad / Android)
   Sin logica: solo presentacion y consistencia visual.
   ========================================================= */

body.admin {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.admin .panel_s,
body.admin .panel {
  overflow: hidden;
}

body.admin .table-responsive {
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  body.admin #header #top_search {
    max-width: clamp(280px, 32vw, 460px);
  }

  body.admin #header .navbar-nav.navbar-right > li > a {
    padding: 0 9px !important;
  }

  body.admin #header .navbar-nav > li.icon > a {
    width: 35px;
    min-width: 35px;
    height: 35px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  :root {
    --dash-pad-inline: clamp(8px, 1.8vw, 16px);
    --dash-pad-top: clamp(8px, 1.2vw, 14px);
    --dash-pad-bottom: clamp(10px, 1.4vw, 16px);
  }

  body.admin #wrapper .content,
  body.admin .content,
  body.admin #content,
  body.admin .content-wrapper {
    padding-left: var(--dash-pad-inline) !important;
    padding-right: var(--dash-pad-inline) !important;
  }

  body.admin #header #top_search {
    max-width: clamp(220px, 34vw, 360px);
  }

  body.admin #menu.sidebar #side-menu > li > a {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 11px;
  }

  body.admin #menu.sidebar #side-menu > li > .nav-second-level {
    margin-left: 22px;
  }

  [dir="rtl"] body.admin #menu.sidebar #side-menu > li > .nav-second-level {
    margin-left: 0;
    margin-right: 22px;
  }

  body.admin .dataTables_wrapper .dataTables_length,
  body.admin .dataTables_wrapper .dt-buttons,
  body.admin .dataTables_wrapper .dataTables_filter {
    float: none !important;
    display: inline-flex;
    align-items: center;
    margin: 0 8px 8px 0 !important;
    vertical-align: middle;
  }

  body.admin .dataTables_wrapper .dataTables_filter label,
  body.admin .dataTables_wrapper .dataTables_length label {
    margin: 0 !important;
  }

  body.admin .dataTables_wrapper .dataTables_filter .input-group {
    width: min(100%, 280px);
  }

  body.admin .dataTables_wrapper > .row:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  body.admin .dataTables_wrapper .dataTables_info {
    margin-bottom: 0;
  }

  body.admin .dataTables_wrapper .dataTables_paginate {
    margin-top: 0;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  body.admin #header nav {
    padding-right: 2px;
  }

  body.admin #header #top_search {
    max-width: clamp(200px, 38vw, 320px);
  }

  body.admin #header .navbar-nav.navbar-right > li:not(.icon):not(.header-user-menu) {
    display: none !important;
  }

  body.admin #header .navbar-nav.navbar-right > li.header-user-menu::before {
    display: none;
  }

  body.admin #header .header-user-menu > .header-user-avatar {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 991px) {
  body.admin #leads_wrapper,
  body.admin #proposals_wrapper,
  body.admin #clients_wrapper,
  body.admin .invoices-list-view #invoices_wrapper {
    min-height: 0 !important;
    height: auto !important;
  }

  body.admin #leads_wrapper .table-responsive,
  body.admin #proposals_wrapper .table-responsive,
  body.admin #clients_wrapper .table-responsive,
  body.admin .invoices-list-view #invoices_wrapper .table-responsive {
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: auto !important;
  }
}

@media (max-width: 767px) {
  :root {
    --topbar-height: 60px;
    --dash-pad-inline: 10px;
    --dash-pad-top: 10px;
    --dash-pad-bottom: 12px;
  }

  body.admin #wrapper .content,
  body.admin .content,
  body.admin #content,
  body.admin .content-wrapper {
    padding-left: var(--dash-pad-inline) !important;
    padding-right: var(--dash-pad-inline) !important;
    padding-top: var(--dash-pad-top) !important;
    padding-bottom: var(--dash-pad-bottom) !important;
  }

  body.admin #header nav {
    padding-left: 4px;
    padding-right: 4px;
  }

  body.admin #header #logo .logo img {
    max-height: 31px;
    width: auto;
  }

  body.admin #header #top_search {
    max-width: min(52vw, 245px);
    margin-left: 2px;
    margin-right: 2px;
  }

  body.admin #header #top_search #search_input {
    height: 37px;
    font-size: 14px;
  }

  body.admin #header .navbar-nav.navbar-right {
    gap: 4px;
    padding-right: 0;
    margin-right: 0 !important;
  }

  body.admin #header .navbar-nav.navbar-right > li {
    display: none !important;
  }

  body.admin #header .navbar-nav.navbar-right > li.header-notifications,
  body.admin #header .navbar-nav.navbar-right > li.header-user-menu {
    display: flex !important;
  }

  body.admin #header .header-user-menu > .header-user-avatar {
    width: 40px;
    height: 40px;
  }

  body.admin #menu.sidebar,
  body.admin #setup-menu-wrapper {
    width: min(86vw, 300px) !important;
  }

  body.admin #menu.sidebar #side-menu {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body.admin #menu.sidebar #side-menu > li > a {
    min-height: 39px;
    font-size: 12.6px;
  }

  body.admin .panel_s,
  body.admin .panel {
    border-radius: 12px !important;
  }

  body.admin .btn,
  body.admin .bootstrap-select > .dropdown-toggle,
  body.admin input.form-control,
  body.admin select.form-control,
  body.admin textarea.form-control {
    min-height: 36px;
    font-size: 13px;
  }

  body.admin .table-responsive > .table {
    min-width: 880px !important;
  }

  body.admin #leads,
  body.admin #proposals,
  body.admin #clients,
  body.admin .invoices-list-view #invoices {
    min-width: 900px;
  }

  body.admin #leads thead th,
  body.admin #leads tbody td,
  body.admin #proposals thead th,
  body.admin #proposals tbody td,
  body.admin #clients thead th,
  body.admin #clients tbody td,
  body.admin .invoices-list-view #invoices thead th,
  body.admin .invoices-list-view #invoices tbody td {
    font-size: 12px;
    padding: 10px 10px;
  }

  body.admin .dataTables_wrapper .dataTables_length,
  body.admin .dataTables_wrapper .dt-buttons,
  body.admin .dataTables_wrapper .dataTables_filter {
    float: none !important;
    display: flex !important;
    align-items: center;
    width: 100%;
    margin: 0 0 8px !important;
  }

  body.admin .dataTables_wrapper .dataTables_filter label,
  body.admin .dataTables_wrapper .dataTables_length label {
    width: 100%;
    margin: 0 !important;
  }

  body.admin .dataTables_wrapper .dataTables_filter .input-group {
    width: 100% !important;
  }

  body.admin .dataTables_wrapper > .row:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  body.admin .dataTables_wrapper .dataTables_info {
    width: 100%;
    margin-bottom: 4px;
  }

  body.admin .dataTables_wrapper .dataTables_paginate {
    width: 100%;
    float: none !important;
    text-align: left !important;
  }

  body.admin .modal-dialog {
    width: calc(100% - 14px);
    margin: 7px auto;
  }

  body.admin .modal-content {
    border-radius: 12px;
  }
}

@supports (padding: max(0px)) {
  @media (max-width: 1024px) {
    body.admin #header nav {
      padding-left: max(4px, env(safe-area-inset-left));
      padding-right: max(4px, env(safe-area-inset-right));
    }

    body.admin #wrapper {
      padding-top: calc(var(--topbar-height) + env(safe-area-inset-top));
    }
  }
}

/* ---------------------------------------------------------
   Fixes finales responsive (capturas iPhone/iPad/Android)
   --------------------------------------------------------- */
@media (max-width: 1199px) {
  :root {
    --responsive-sidebar-width: min(82vw, 300px);
  }

  body.admin #header,
  body.admin #wrapper {
    margin-left: 0 !important;
  }

  body.admin #menu.sidebar,
  body.admin #setup-menu-wrapper {
    width: var(--responsive-sidebar-width) !important;
    margin-left: calc(-1 * var(--responsive-sidebar-width)) !important;
    left: 0 !important;
    bottom: 0 !important;
    height: calc(100vh - var(--topbar-height)) !important;
    height: calc(100dvh - var(--topbar-height)) !important;
    max-height: calc(100vh - var(--topbar-height)) !important;
    max-height: calc(100dvh - var(--topbar-height)) !important;
    transition: margin-left 0.24s ease;
  }

  body.admin.page-small.show-sidebar #menu.sidebar,
  body.admin.page-small.show-sidebar #setup-menu-wrapper,
  body.admin.show-sidebar #menu.sidebar,
  body.admin.show-sidebar #setup-menu-wrapper {
    margin-left: 0 !important;
  }

  body.admin.page-small #wrapper,
  body.admin.page-small.show-sidebar #wrapper,
  body.admin.show-sidebar #wrapper {
    margin-left: 0 !important;
  }

  body.admin.show-sidebar #wrapper::after {
    content: "";
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.28);
    z-index: 97;
    pointer-events: auto;
  }

  [dir="rtl"] body.admin #menu.sidebar,
  [dir="rtl"] body.admin #setup-menu-wrapper {
    left: auto !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: calc(-1 * var(--responsive-sidebar-width)) !important;
  }

  [dir="rtl"] body.admin.page-small.show-sidebar #menu.sidebar,
  [dir="rtl"] body.admin.page-small.show-sidebar #setup-menu-wrapper,
  [dir="rtl"] body.admin.show-sidebar #menu.sidebar,
  [dir="rtl"] body.admin.show-sidebar #setup-menu-wrapper {
    margin-right: 0 !important;
  }

  body.admin #menu.sidebar #side-menu > li > a {
    min-height: 40px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  :root {
    --responsive-sidebar-gap: 12px;
  }

  body.admin.page-small.show-sidebar #wrapper,
  body.admin.show-sidebar #wrapper {
    margin-left: calc(var(--responsive-sidebar-width) + var(--responsive-sidebar-gap)) !important;
    transition: margin-left 0.24s ease;
  }

  body.admin.show-sidebar #wrapper::after {
    display: none !important;
  }

  body.admin.page-small.show-sidebar #menu.sidebar,
  body.admin.show-sidebar #menu.sidebar {
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.35);
    border-right: 1px solid rgba(16, 36, 64, 0.52);
  }

  body.admin.page-small.show-sidebar #menu.sidebar::before,
  body.admin.show-sidebar #menu.sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: calc(-1 * var(--responsive-sidebar-gap));
    width: var(--responsive-sidebar-gap);
    background: linear-gradient(180deg, #0f2238 0%, #152f4b 100%);
    pointer-events: none;
  }

  [dir="rtl"] body.admin.page-small.show-sidebar #wrapper,
  [dir="rtl"] body.admin.show-sidebar #wrapper {
    margin-left: 0 !important;
    margin-right: calc(var(--responsive-sidebar-width) + var(--responsive-sidebar-gap)) !important;
  }

  [dir="rtl"] body.admin.page-small.show-sidebar #menu.sidebar,
  [dir="rtl"] body.admin.show-sidebar #menu.sidebar {
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.35);
    border-right: 0;
    border-left: 1px solid rgba(16, 36, 64, 0.52);
  }

  [dir="rtl"] body.admin.page-small.show-sidebar #menu.sidebar::before,
  [dir="rtl"] body.admin.show-sidebar #menu.sidebar::before {
    right: auto;
    left: calc(-1 * var(--responsive-sidebar-gap));
  }
}

@media (max-width: 991px) {
  body.admin #header nav > .tw-flex {
    gap: 6px;
  }

  body.admin #header .tw-flex.tw-flex-1 {
    min-width: 0;
    flex: 1 1 auto;
  }

  body.admin #header #top_search {
    min-width: 0;
    flex: 1 1 auto;
    max-width: none;
  }

  body.admin #header #top_search #search_input {
    width: 100% !important;
  }

  body.admin ._buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.admin ._buttons .pull-left,
  body.admin ._buttons .pull-right {
    float: none !important;
    margin: 0 !important;
  }

  body.admin ._buttons .display-block.pull-right {
    width: 100%;
  }
}

@media (max-width: 767px) {
  body.admin #header .mobile-menu,
  body.admin #header .mobile-menu-toggle {
    display: none !important;
  }

  body.admin #header #top_search {
    max-width: none;
    width: 100%;
  }

  body.admin #header .navbar-nav.navbar-right {
    gap: 3px;
  }

  body.admin #header .navbar-nav.navbar-right > li.header-notifications > a,
  body.admin #header .navbar-nav.navbar-right > li.header-user-menu > a {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  body.admin #header .header-user-menu > .header-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    overflow: hidden !important;
    padding: 0 !important;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.admin #header .header-user-menu > .header-user-avatar .staff-profile-image-small,
  body.admin #header .header-user-menu > .header-user-avatar .staff-profile-image-small.img-responsive {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: 50% !important;
    -webkit-clip-path: circle(50% at 50% 50%) !important;
    clip-path: circle(50% at 50% 50%) !important;
    transform: scale(2.05) !important;
    transform-origin: center center !important;
  }

  body.admin .leads-overview .tw-grid,
  body.admin .clients-page .tw-grid {
    grid-template-columns: 1fr !important;
  }

  body.admin .app-menu__filters,
  body.admin app-filters,
  body.admin ._buttons app-filters {
    width: 100%;
  }

  body.admin #leads_wrapper .dataTables_filter .input-group,
  body.admin #proposals_wrapper .dataTables_filter .input-group,
  body.admin #clients_wrapper .dataTables_filter .input-group,
  body.admin .invoices-list-view #invoices_wrapper .dataTables_filter .input-group {
    width: 100% !important;
  }

  body.admin #leads_wrapper .dt-buttons,
  body.admin #proposals_wrapper .dt-buttons,
  body.admin #clients_wrapper .dt-buttons,
  body.admin .invoices-list-view #invoices_wrapper .dt-buttons {
    flex-wrap: wrap;
  }
}

/* ---------------------------------------------------------
   Responsive calibration v2 (iPhone/Android/iPad/Tablet/Laptop)
   --------------------------------------------------------- */
@media (max-width: 575px) {
  :root {
    --topbar-height: 58px;
    --responsive-sidebar-width: min(84vw, 320px);
  }

  body.admin #header nav {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  body.admin #header nav > .tw-flex {
    gap: 6px;
  }

  body.admin #header .hide-menu {
    margin-left: 6px !important;
    margin-right: 6px !important;
  }

  body.admin #header #top_search {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100%;
    min-width: 0;
  }

  body.admin #header #top_search #search_input {
    height: 38px;
    border-radius: 12px !important;
  }

  body.admin #header .navbar-nav.navbar-right > li.header-notifications > a,
  body.admin #header .navbar-nav.navbar-right > li.header-user-menu > a {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  body.admin #header .header-user-menu > .header-user-avatar {
    width: 40px;
    height: 40px;
    border-width: 2px;
    border-radius: 50% !important;
    overflow: hidden !important;
  }

  body.admin #header .header-user-menu > .header-user-avatar .staff-profile-image-small {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transform: scale(1.35) !important;
    border-radius: 50% !important;
    clip-path: circle(50% at 50% 50%) !important;
  }

  body.admin #menu.sidebar,
  body.admin #setup-menu-wrapper {
    width: var(--responsive-sidebar-width) !important;
  }

  body.admin .table-responsive > .table {
    min-width: 820px !important;
  }

  body.admin #leads,
  body.admin #proposals,
  body.admin #clients,
  body.admin .invoices-list-view #invoices {
    min-width: 840px !important;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  :root {
    --topbar-height: 58px;
    --responsive-sidebar-width: min(78vw, 340px);
  }

  body.admin #header #top_search {
    width: 100%;
  }

  body.admin #header .header-user-menu > .header-user-avatar .staff-profile-image-small {
    transform: scale(1.3) !important;
  }

  body.admin #menu.sidebar,
  body.admin #setup-menu-wrapper {
    width: var(--responsive-sidebar-width) !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  :root {
    --topbar-height: 60px;
    --responsive-sidebar-width: min(38vw, 330px);
  }

  body.admin.page-small.show-sidebar #wrapper,
  body.admin.show-sidebar #wrapper {
    margin-left: calc(var(--responsive-sidebar-width) + 14px) !important;
  }

  [dir="rtl"] body.admin.page-small.show-sidebar #wrapper,
  [dir="rtl"] body.admin.show-sidebar #wrapper {
    margin-left: 0 !important;
    margin-right: calc(var(--responsive-sidebar-width) + 14px) !important;
  }

  body.admin #header #top_search {
    max-width: clamp(220px, 42vw, 430px);
  }

  body.admin #header .navbar-nav.navbar-right > li:not(.icon):not(.header-user-menu) {
    display: none !important;
  }

  body.admin #header .navbar-nav.navbar-right > li.header-user-menu::before {
    display: none !important;
  }

  body.admin #header .header-user-menu > .header-user-avatar {
    width: 42px;
    height: 42px;
  }

  body.admin #header .header-user-menu > .header-user-avatar .staff-profile-image-small {
    transform: scale(1.22) !important;
  }

  body.admin #wrapper .content,
  body.admin .content,
  body.admin #content,
  body.admin .content-wrapper {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

@media (min-width: 1025px) and (max-width: 1366px) {
  :root {
    --topbar-height: 58px;
    --sidebar-width: clamp(220px, 18vw, 270px);
  }

  body.admin #header #top_search {
    max-width: clamp(300px, 31vw, 450px);
  }

  body.admin #wrapper .content,
  body.admin .content,
  body.admin #content,
  body.admin .content-wrapper {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body.admin #menu.sidebar #side-menu > li > a {
    min-height: 41px;
  }
}

@media (min-width: 1367px) and (max-width: 1600px) {
  :root {
    --sidebar-width: clamp(230px, 16vw, 275px);
  }

  body.admin #header #top_search {
    max-width: clamp(320px, 28vw, 500px);
  }

  body.admin #wrapper .content,
  body.admin .content,
  body.admin #content,
  body.admin .content-wrapper {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

@media (min-width: 1601px) {
  :root {
    --sidebar-width: clamp(240px, 15vw, 285px);
  }

  body.admin #header #top_search {
    max-width: clamp(360px, 26vw, 560px);
  }

  body.admin #wrapper .content,
  body.admin .content,
  body.admin #content,
  body.admin .content-wrapper {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
}

/* ---------------------------------------------------------
   Tema global de tablas (mismo look que Prospectos)
   --------------------------------------------------------- */
body.admin #wrapper .dataTables_wrapper .dataTables_length label,
body.admin #wrapper .dataTables_wrapper .dataTables_filter label {
  color: #475569;
  font-weight: 600;
}

body.admin #wrapper .dataTables_wrapper .dataTables_filter .input-group {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

body.admin #wrapper .dataTables_wrapper .dataTables_filter .input-group-addon {
  border: 0;
  background: #fff;
  color: #64748b;
}

body.admin #wrapper .dataTables_wrapper .dataTables_filter input[type="search"] {
  border: 0;
  box-shadow: none;
  height: 36px;
  color: #0f172a;
}

body.admin #wrapper .dataTables_wrapper .dataTables_length select {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  height: 36px;
  padding: 4px 30px 4px 10px;
  color: #0f172a;
  background-color: #fff;
}

body.admin #wrapper .dataTables_wrapper .dt-buttons .btn,
body.admin #wrapper .dataTables_wrapper .dt-button {
  border: 1px solid #dbe3ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body.admin #wrapper .dataTables_wrapper .dt-buttons .btn:hover,
body.admin #wrapper .dataTables_wrapper .dt-button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body.admin #wrapper .dataTables_wrapper .table-responsive {
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: transparent !important;
  box-shadow: none;
  margin-top: 0 !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

body.admin #wrapper .dataTables_wrapper .table-responsive::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.admin #wrapper .dataTables_wrapper .table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

body.admin #wrapper .dataTables_wrapper .table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

body.admin #wrapper .dataTables_wrapper table.dataTable {
  width: 100% !important;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0 6px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
  margin-top: 0 !important;
}

body.admin #wrapper .dataTables_wrapper table.dataTable thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #edf3fa 100%);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 6;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #dbe4ef;
}


/* Filtros por tabla: siempre por encima de encabezados sticky */
body.admin #wrapper app-filters,
body.admin #wrapper .app-menu__filters,
body.admin #wrapper app-filters .btn-group,
body.admin #wrapper .app-menu__filters .btn-group {
  position: relative;
  z-index: 1200 !important;
}

body.admin #wrapper app-filters .dropdown-menu,
body.admin #wrapper .app-menu__filters .dropdown-menu,
body.admin #wrapper app-filters .btn-group.open > .dropdown-menu,
body.admin #wrapper .app-menu__filters .btn-group.open > .dropdown-menu {
  z-index: 1210 !important;
}

body.admin #wrapper .dataTables_wrapper table.dataTable thead th + th {
  border-left: 1px solid #dfe7f3;
}

body.admin #wrapper .dataTables_wrapper table.dataTable tbody td {
  vertical-align: middle;
  padding: 12px 14px;
  font-size: 13px;
  border-top: 1px solid #e6edf6;
  border-bottom: 1px solid #e6edf6;
  color: #334155;
  font-weight: 500;
  background: #fff;
  line-height: 1.35;
}

body.admin #wrapper .dataTables_wrapper table.dataTable tbody td + td {
  border-left: 1px solid #e4ecf6;
  box-shadow: inset 1px 0 0 #f5f8fc;
}

body.admin #wrapper .dataTables_wrapper table.dataTable tbody tr td:first-child {
  border-left: 1px solid #e6edf6;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

body.admin #wrapper .dataTables_wrapper table.dataTable tbody tr td:last-child {
  border-right: 1px solid #e6edf6;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

body.admin #wrapper .dataTables_wrapper table.dataTable tbody tr:hover td {
  background: #f8fbff;
  border-color: #dce7f5;
}

body.admin #wrapper .dataTables_wrapper table.dataTable tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 #337ab7;
}

body.admin #wrapper .dataTables_wrapper .dataTables_info {
  color: #64748b;
  font-weight: 500;
}

body.admin #wrapper .dataTables_wrapper .pagination > li > a,
body.admin #wrapper .dataTables_wrapper .pagination > li > span {
  border: 1px solid #dbe3ee;
  color: #334155;
  margin-left: 4px;
  border-radius: 8px !important;
  background: #fff;
}

body.admin #wrapper .dataTables_wrapper .pagination > li > a:hover,
body.admin #wrapper .dataTables_wrapper .pagination > li > span:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.admin #wrapper .dataTables_wrapper .pagination > .active > a,
body.admin #wrapper .dataTables_wrapper .pagination > .active > a:focus,
body.admin #wrapper .dataTables_wrapper .pagination > .active > a:hover,
body.admin #wrapper .dataTables_wrapper .pagination > .active > span,
body.admin #wrapper .dataTables_wrapper .pagination > .active > span:focus,
body.admin #wrapper .dataTables_wrapper .pagination > .active > span:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

@media (max-width: 768px) {
  body.admin #wrapper .dataTables_wrapper table.dataTable {
    min-width: 900px;
  }

  body.admin #wrapper .dataTables_wrapper table.dataTable thead th,
  body.admin #wrapper .dataTables_wrapper table.dataTable tbody td {
    padding: 10px 10px;
    font-size: 12px;
  }
}

/* Fix: evita recorte de numeros en selector de cantidad de DataTables */
body.admin #wrapper .dataTables_wrapper .dataTables_length select {
  height: 38px;
  min-height: 38px;
  line-height: normal;
  padding-top: 0;
  padding-bottom: 0;
}

body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select {
  min-width: 92px;
}

body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle {
  height: 38px;
  min-height: 38px;
  line-height: 1.3 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  display: inline-flex;
  align-items: center;
}

body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle .filter-option {
  display: inline-flex;
  align-items: center;
  line-height: 1.25;
}

body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle .caret {
  top: 50% !important;
  margin-top: 0 !important;
  transform: translateY(-50%);
}

body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle,
body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle:focus,
body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle:hover {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 12px !important;
  padding-right: 30px !important;
}

body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle .filter-option,
body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle .filter-option-inner,
body.admin #wrapper .dataTables_wrapper .dataTables_length .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
  height: auto !important;
  line-height: 38px !important;
  overflow: visible !important;
  font-size: 14px;
  white-space: nowrap;
}

/* HR Profile: tabla de cargos, columnas 3 y 6 en una sola linea */
body.admin #table-table_job_position thead th:nth-child(3),
body.admin #table-table_job_position tbody td:nth-child(3),
body.admin #table-table_job_position thead th:nth-child(6),
body.admin #table-table_job_position tbody td:nth-child(6) {
  white-space: nowrap !important;
}

body.admin #table-table_job_position .hr-job-position-nowrap,
body.admin #table-table_job_position .hr-job-group-nowrap {
  white-space: nowrap !important;
  display: inline-block;
}

/* Politica global: todo en una linea excepto columnas de descripcion */
body.admin #wrapper .dataTables_wrapper table.dataTable tbody td {
  white-space: nowrap !important;
}

body.admin #wrapper .dataTables_wrapper table.dataTable tbody td.dt-col-description {
  white-space: normal !important;
  word-break: break-word;
}

/* Items: ajustar ancho de "Descripción larga" para lectura más compacta */
body.admin #invoice-items_wrapper table#invoice-items thead th:nth-child(2),
body.admin #invoice-items_wrapper table#invoice-items tbody td:nth-child(2) {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

body.admin #invoice-items_wrapper table#invoice-items thead th:nth-child(3),
body.admin #invoice-items_wrapper table#invoice-items tbody td:nth-child(3) {
  width: 420px;
  min-width: 420px;
  max-width: 420px;
}

body.admin #invoice-items_wrapper table#invoice-items {
  table-layout: fixed;
}

body.admin #invoice-items_wrapper table#invoice-items tbody td:nth-child(2),
body.admin #invoice-items_wrapper table#invoice-items tbody td:nth-child(3) {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------
   Payroll-inspired Global UI Layer
   --------------------------------------------------------- */
:root {
  --ui-surface-0: #ffffff;
  --ui-surface-1: #f8fafc;
  --ui-surface-2: #eef3fb;
  --ui-border-1: #dbe4ef;
  --ui-border-2: #cdd9e8;
  --ui-text-1: #1f2937;
  --ui-text-2: #475569;
  --ui-primary: #2563eb;
  --ui-primary-strong: #1d4ed8;
  --ui-radius-sm: 8px;
  --ui-radius-md: 10px;
  --ui-radius-lg: 12px;
  --ui-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
}

body.admin .panel_s,
body.admin .panel {
  border: 1px solid var(--ui-border-1);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-sm);
  background: var(--ui-surface-0);
}

body.admin .panel_s .panel-body,
body.admin .panel .panel-body {
  border-radius: var(--ui-radius-lg);
}

body.admin .hr-panel-heading,
body.admin .hr-panel-heading-dashboard {
  border-color: #e6edf6 !important;
}

body.admin .btn {
  border-radius: var(--ui-radius-md);
  font-weight: 600;
}

body.admin .btn-default {
  border-color: var(--ui-border-2);
  color: #334155;
  background: #fff;
}

body.admin .btn-default:hover,
body.admin .btn-default:focus {
  background: var(--ui-surface-1);
  border-color: #b8c6da;
}

body.admin .btn-info {
  background: linear-gradient(180deg, #2f6fec 0%, #2459c6 100%);
  border-color: #2b5fcc;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

body.admin .btn-info:hover,
body.admin .btn-info:focus {
  background: linear-gradient(180deg, #2b63d4 0%, #204db0 100%);
  border-color: #234fae;
}

body.admin .form-control,
body.admin .bootstrap-select > .dropdown-toggle {
  border-radius: var(--ui-radius-sm) !important;
  border-color: var(--ui-border-1) !important;
  color: var(--ui-text-1);
  box-shadow: none !important;
}

body.admin .form-control:focus,
body.admin .bootstrap-select > .dropdown-toggle:focus {
  border-color: #90afd8 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

body.admin .control-label,
body.admin label {
  color: var(--ui-text-2);
  font-weight: 700;
}

body.admin .modal-content {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--ui-border-1);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.2);
}

body.admin .modal-header,
body.admin .modal-footer {
  border-color: #e6edf6;
}

body.admin .badge {
  border-radius: 999px;
  font-weight: 700;
}

body.admin .table tbody tr:hover td {
  background-color: #f8fbff;
}
