/* ✅ CHAT ADVANCED STYLES */
.chat-msg-container .msg-actions {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chat-msg-container:hover .msg-actions {
  opacity: 1;
}

.cursor-pointer {
  cursor: pointer;
}

.mention-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
}

.mention-item:hover,
.mention-item.active {
  background: rgba(108, 99, 255, 0.2);
}

.mention-item img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.trans-all {
  transition: all 0.2s ease;
}

.hover-opacity-100:hover {
  opacity: 1 !important;
}

.reply-bubble {
  font-style: italic;
  border-left: 3px solid var(--cc-accent);
  padding-left: 10px;
  margin-bottom: 5px;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.05);
}

.emoji-list button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.2);
  transition: transform 0.1s;
}

#sticker-list button:hover {
  transform: scale(1.1);
  transition: transform 0.1s;
}

.pulse-accent {
  outline: 2px solid var(--cc-accent);
  animation: pulse-border 1s infinite;
}

@keyframes pulse-border {
  0% {
    outline-color: rgba(108, 99, 255, 0.5);
  }

  50% {
    outline-color: rgba(108, 99, 255, 1);
  }

  100% {
    outline-color: rgba(108, 99, 255, 0.5);
  }
}

.hover-bg-light:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Base styles... */
:root {
  /* ── Base Palette ── */
  --bg0: #0f141c;
  --bg1: #141b25;
  --bg2: #1a2230;

  --panel: #1c2431;
  --panel2: #232c3b;

  --text: #e7edf6;
  --muted: #98a6b8;

  --line: rgba(255, 255, 255, .06);
  --shadow: 0 18px 55px rgba(0, 0, 0, .55);
  --shadow2: 0 10px 28px rgba(0, 0, 0, .45);

  --r12: 12px;
  --r16: 16px;
  --r20: 20px;

  --blue: #2f7cff;
  --green: #29c56f;
  --purple: #6c63ff;

  /* ── Theme (Consolidated from themeA) ── */
  --cc-bg: #0b1220;
  --cc-panel: #0f1a2d;
  --cc-panel-2: #111f36;
  --cc-border: rgba(255, 255, 255, .07);
  --cc-text: rgba(255, 255, 255, .88);
  --cc-muted: rgba(255, 255, 255, .62);
  --cc-accent: #4f7cff;
  --cc-accent-2: #22c55e;
  --cc-danger: #ef4444;
  --cc-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  --cc-radius: 16px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

/* ✅ SCROLL FIX GLOBAL */
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 35%, #2a3a53 0%, rgba(42, 58, 83, 0) 60%),
    radial-gradient(900px 600px at 65% 65%, #243244 0%, rgba(36, 50, 68, 0) 55%),
    linear-gradient(180deg, #0d1219 0%, #0b1017 35%, #070b10 100%);

  /* antes: overflow:hidden; */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* iOS Safe Area */
  padding-bottom: env(safe-area-inset-bottom);
}

.small-muted {
  color: var(--muted)
}

/* Shell layout */
.cc-sidebar {
  position: fixed;
  top: 14px;
  bottom: 14px;
  left: 14px;
  width: 260px;
  z-index: 1000;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 18px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.cc-sidebar::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari and Opera */
}

.cc-main,
.cc-panel {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.cc-shell {
  background: var(--cc-bg, var(--bg0));
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: 14px;
  margin-left: 276px;
  /* Espacio para el sidebar fijo */
  display: block;
}

.cc-main {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

@media (max-width: 1100px) {
  .cc-panel {
    display: none;
  }
}

@media (max-width: 800px) {
  .cc-shell {
    margin-left: 0;
    padding: 10px;
  }
}

.cc-panel {
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cc-panel-hidden {
  display: none
}

/* Sidebar */
.cc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 16px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

/* ✅ tu CSS usaba .cc-logo, pero sidebar.php tiene .logo */
.logo,
.cc-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7dd2ff 0%, #2a86ff 35%, #1550b8 100%);
  box-shadow: 0 10px 24px rgba(47, 124, 255, .25);
  position: relative;
}

.cc-brand h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: .2px;
}

.cc-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 6px;
}

.cc-nav a {
  text-decoration: none;
  color: rgba(231, 237, 246, .72);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: .15s ease;
  font-size: 14px;
}

.cc-nav a:hover {
  background: rgba(255, 255, 255, .04);
  color: var(--text);
}

.cc-nav a.active {
  color: #eaf1ff;
  background: linear-gradient(180deg, rgba(47, 124, 255, .35), rgba(47, 124, 255, .18));
  border: 1px solid rgba(47, 124, 255, .35);
  box-shadow: 0 10px 24px rgba(47, 124, 255, .16);
}

.cc-nav .ic {
  width: 22px;
  text-align: center;
  opacity: .9
}

/* Icons filter fix for better visibility and requested look */
.cc-sidebar .nav-link img {
  filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(6, 3, 0, .25));
  -webkit-filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(6, 3, 0, .25));
  transition: filter .15s ease;
  pointer-events: none;
  /* Evita que la imagen intercepte el click antes que el <a> */
}

/* Fix para iOS: asegurar que los enlaces sean clicables */
.cc-sidebar .nav-link {
  cursor: pointer !important;
  -webkit-tap-highlight-color: rgba(47, 124, 255, 0.1);
  position: relative;
  z-index: 1;
}

/* Topbar */
.cc-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
}

.cc-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 220px;
}

.cc-search-ic {
  opacity: .7
}

.cc-search-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

/* ═══ Global Search Dropdown ═══ */
.cc-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 380px;
  max-height: 420px;
  overflow-y: auto;
  background: rgba(18, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  z-index: 99999;
  padding: 6px;
  animation: ccSearchFadeIn 0.15s ease;
}

@keyframes ccSearchFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

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

.cc-search-dropdown::-webkit-scrollbar {
  width: 5px;
}

.cc-search-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.cc-sr-group {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--cc-accent, #6c63ff);
  padding: 10px 12px 4px;
  opacity: 0.85;
}

.cc-sr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--cc-text, #e7edf6);
  text-decoration: none;
  transition: background 0.12s;
  cursor: pointer;
}

.cc-sr-item:hover,
.cc-sr-item.cc-sr-active {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.cc-sr-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.cc-sr-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cc-sr-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-sr-sub {
  font-size: 11px;
  opacity: 0.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-sr-empty {
  text-align: center;
  padding: 24px 16px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
}

.cc-top-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.cc-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(231, 237, 246, .75);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: rgba(0, 0, 0, .18);
}

.cc-pill b {
  color: var(--text);
  font-weight: 800
}

#cc-chat-badge {
  box-shadow: 0 0 10px rgba(255, 91, 91, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 800;
}

/* Content */
.cc-content {
  padding: 16px 18px 18px 18px;

  /* ✅ Desktop app-shell: scroll interno */
  overflow: auto;
  min-height: 0;

  -webkit-overflow-scrolling: touch;
}

/* Panel derecho */
.cc-panel-head {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
}

.cc-panel-body {
  padding: 14px 16px;
  overflow: auto;
  min-height: 0;

  -webkit-overflow-scrolling: touch;
}

/* Cards */
.cc-card {
  background: rgba(0, 0, 0, .14);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 18px;
  box-shadow: var(--shadow2);
}

/* Controls */
.cc-input,
.form-control,
.form-select {
  background: rgba(255, 255, 255, .06) !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
  color: var(--text) !important;
  color-scheme: dark;
}

.form-control:focus,
.form-select:focus {
  box-shadow: none !important;
  border-color: rgba(108, 99, 255, .35) !important;
}

/* ✅ iOS ZOOM FIX: font-size >= 16px */
@media (max-width: 800px) {

  .cc-input,
  .form-control,
  .form-select,
  .cc-search-input {
    font-size: 16px !important;
  }
}

/* Opciones del select */
.form-select.cc-input option {
  background-color: #0f141c;
  color: #e7edf6;
}

/* Buttons */
.btn-cc-scan {
  background: linear-gradient(180deg, rgba(41, 197, 111, .95), rgba(23, 156, 82, .92));
  border: 1px solid rgba(41, 197, 111, .35);
  color: #fff;
  font-weight: 900;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 18px 36px rgba(41, 197, 111, .18);
}

.btn-cc-scan:active {
  transform: translateY(1px)
}

.btn-cc-outline {
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 900;
  text-decoration: none;
}

.btn-cc-outline:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

/* Small badge used in inventory */
.cc-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(0, 0, 0, .18);
  font-weight: 900;
  font-size: 12px;
  color: var(--text);
}

/* Inventory inside shell */
.cc-inv-grid {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 16px;
}

.cc-inv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;

  max-height: calc(100svh - 260px);
  max-height: calc(100dvh - 260px);

  overflow: auto;
  padding-right: 8px;

  -webkit-overflow-scrolling: touch;
}

.cc-inv-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .16);
  cursor: pointer;
}

.cc-inv-row:hover {
  background: rgba(0, 0, 0, .20);
}

.cc-inv-row.active {
  outline: 2px solid rgba(108, 99, 255, .35);
}

.cc-thumb {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: 20px;
}

.cc-meta {
  min-width: 0;
  flex: 1;
}

.cc-name {
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-sub {
  color: rgba(231, 237, 246, .70);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-inv-panel {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .16);
  overflow: hidden;
}

.cc-inv-panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-inv-panel-body {
  padding: 14px 16px;
}

.cc-unit {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  margin-bottom: 12px;
}

/* Subtle scrollbar */
.cc-content::-webkit-scrollbar,
.cc-inv-list::-webkit-scrollbar,
.cc-panel-body::-webkit-scrollbar,
#cc-mention-suggestions::-webkit-scrollbar {
  width: 10px;
}

.cc-content::-webkit-scrollbar-thumb,
.cc-inv-list::-webkit-scrollbar-thumb,
.cc-panel-body::-webkit-scrollbar-thumb,
#cc-mention-suggestions::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .10);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, .25);
}

/* Responsive: hide right panel on small screens */
@media (max-width: 1100px) {
  .cc-shell {
    grid-template-columns: clamp(200px, 26vw, 255px) minmax(0, 1fr);
  }

  .cc-panel {
    display: none;
  }
}

/* ✅ MÓVIL: 1 columna + scroll natural del body — se maneja ahora en el bloque de 800px abajo */


/* ===== Fix: iconos del index NO gigantes ===== */
.module-grid img {
  width: 120px !important;
  height: 120px !important;
  object-fit: contain !important;
  display: block;
  margin: 0 auto 12px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Index: cards de módulos ===== */
.module-grid {
  margin-top: 12px;
}

a.module {
  text-decoration: none;
  color: inherit;
  display: block;
}

.module-card {
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  min-height: 220px;
}

.module-card img {
  mix-blend-mode: lighten;
  border-radius: 12px;
}

.module-card:hover img {
  mix-blend-mode: lighten;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .12);
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .04));
}

.module-card h4 {
  margin: 0;
  font-weight: 900;
  font-size: 20px;
  text-align: center;
  color: rgba(234, 241, 255, .96);
}

.module-card p {
  margin: 8px 0 0;
  text-align: center;
  color: rgba(234, 241, 255, .70);
  font-weight: 700;
  font-size: 13.5px;
}

.module-card.disabled {
  opacity: .55;
  filter: grayscale(.25);
  pointer-events: none;
}

/* =======================================================================
   INDEX - neumórfico
   ======================================================================= */

.neu-wrap {
  /* ✅ HOTFIX: fondo uniforme en páginas con layout neu-* (index) */
  background: var(--cc-bg, var(--bg0));

  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: 36px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.card-neu {
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.card-neu-inner {
  background: rgba(0, 0, 0, .14);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 18px;
  box-shadow: var(--shadow2);
}

.module-card .card-neu-inner,
.module-card.card-neu-inner {
  background: transparent;
}

.neu-title {
  font-weight: 900;
  letter-spacing: .2px;
}

.neu-accent-text {
  color: var(--purple);
}

.text-neu-muted {
  color: rgba(231, 237, 246, .70);
}

.btn-neu {
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.btn-neu:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.btn-neu-accent {
  border: 1px solid rgba(108, 99, 255, .45);
  background: rgba(108, 99, 255, .22);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.btn-neu-accent:hover {
  background: rgba(108, 99, 255, .30);
  color: var(--text);
}

.badge-role {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(0, 0, 0, .18);
  color: var(--text);
  font-weight: 900;
  font-size: 13px;
}

.alert-neu {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .18);
  padding: 12px 14px;
}



/* === Modal base (Detalle) === */
.cc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .55);

  /* clave: si el modal es más alto que la pantalla */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 14px;

  /* Safari iOS center fix */
  display: flex;
  align-items: center;
  /* Centered instead of flex-start */
  justify-content: center;
}

.cc-modal-hidden {
  display: none !important;
}

.cc-modal {
  width: min(920px, 96vw);
  margin: 0 auto;

  background: rgba(20, 27, 37, .96);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .55);

  /* clave: no puede superar la ventana */
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
}

.cc-modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.cc-modal-body {
  flex: 1 1 auto;

  /* clave: el scroll ocurre aquí */
  overflow-y: auto;
  padding: 14px 16px;

  -webkit-overflow-scrolling: touch;
}

.cc-modal-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.cc-modal-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.cc-modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}


/* --- Phase 0: Drawer móvil (menú lateral) --- */
.cc-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
  /* Encima de todo al inicio */
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.cc-overlay {
  display: block;
  /* Siempre bloque, controlamos con opacity/visibility */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 998;
  cursor: pointer;
  /* Crucial para iOS */
  transition: opacity .25s ease, visibility .25s ease;
}

@media (max-width: 800px) {
  .cc-hamburger {
    display: inline-flex !important;
    z-index: 1035 !important;
  }

  .cc-shell {
    grid-template-columns: 1fr !important;
    transform: none !important;
  }

  .cc-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    z-index: 1030 !important;
    visibility: hidden;
    transform: translateX(-105%) !important;
    -webkit-transform: translateX(-105%) !important;
    transition: transform 0.3s ease, visibility 0.3s ease !important;
    background: var(--cc-bg, #0b1220) !important;
    display: block !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
    border-radius: 0 !important;
    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  body.cc-sidebar-open .cc-sidebar {
    visibility: visible !important;
    transform: translateX(0) !important;
    -webkit-transform: translateX(0) !important;
  }

  body.cc-sidebar-open .cc-hamburger {
    pointer-events: auto !important;
    position: relative;
    z-index: 1015 !important;
  }

  .cc-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1010 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none !important;
  }

  body.cc-sidebar-open .cc-overlay {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.cc-sidebar-open {
    overflow: hidden !important;
  }

  .cc-topbar {
    height: auto !important;
    min-height: 64px !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }

  .cc-search {
    min-width: 100px !important;
    flex: 1 !important;
  }

  .cc-top-pills {
    display: none !important;
  }

  .btn-cc-scan {
    flex-shrink: 0 !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    letter-spacing: -0.2px !important;
  }

  .cc-sidebar .nav-link {
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 200001 !important;
  }
}


/* ===== Dashboard grids opcion A ===== */
.cc-kpi-grid-4 {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cc-grid-2-1 {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

@media (max-width: 900px) {
  .cc-kpi-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .cc-kpi-grid-4 {
    grid-template-columns: 1fr;
  }

  .cc-grid-2-1 {
    grid-template-columns: 1fr;
  }
}


/* Settings form controls (Bootstrap) */
.card-neu .form-control,
.card-neu .form-select {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
  color: var(--text);
}

.card-neu .form-control::placeholder {
  color: rgba(231, 237, 246, .45)
}

.card-neu .form-control:focus,
.card-neu .form-select:focus {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(108, 99, 255, .45);
  box-shadow: 0 0 0 .2rem rgba(108, 99, 255, .18);
  color: var(--text);
}

.table.table-dark {
  --bs-table-bg: rgba(0, 0, 0, .15);
  --bs-table-striped-bg: rgba(255, 255, 255, .03);
  --bs-table-hover-bg: rgba(255, 255, 255, .05);
  --bs-table-border-color: rgba(255, 255, 255, .08);
}

/* === FIX: placeholders visibles en dark mode === */
.cc-input::placeholder,
.form-control::placeholder {
  color: rgba(231, 237, 246, .55);
  opacity: 1;
  /* override bootstrap */
}

.form-select {
  color: rgba(231, 237, 246, .95);
}

/* =========================
   Locations – Bootstrap modal (dark)
   ========================= */
/* ✅ Fix: evitar scroll del body al abrir modal */
body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
  /* evitar salto si bootstrap añade padding */
}

/* =========================
   Global Dark Modal Styles
   ========================= */
.modal-content {
  background: rgba(18, 26, 38, 0.98);
  color: rgba(235, 242, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
}

.modal-header,
.modal-footer {
  border-color: rgba(255, 255, 255, .10);
}

.modal-header .btn-close {
  filter: invert(1);
  opacity: .85;
}

.modal-body .form-label,
.modal-body .form-text {
  color: rgba(235, 242, 255, 0.72);
}

/* Specific override for #locCreateModal kept for backward compat if needed, 
   but generalized rule above covers it. */
#locCreateModal .modal-content-ignore {
  background: rgba(18, 26, 38, 0.98);
  color: rgba(235, 242, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
}

#locCreateModal .modal-header,
#locCreateModal .modal-footer {
  border-color: rgba(255, 255, 255, .10);
}

#locCreateModal .btn-close {
  filter: invert(1);
  opacity: .85;
}

#locCreateModal .form-label,
#locCreateModal .form-text {
  color: rgba(235, 242, 255, 0.72);
}

#locCreateModal .form-control {
  background: rgba(255, 255, 255, .06);
  color: rgba(235, 242, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, .10);
}

#locCreateModal .form-control:focus {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(108, 99, 255, .45);
  box-shadow: 0 0 0 .2rem rgba(108, 99, 255, .18);
}

#locCreateModal .form-control::placeholder {
  color: rgba(231, 237, 246, .55);
}

/* Buttons – danger (CrewCore) */
.btn-neu-danger {
  border: 1px solid rgba(255, 77, 110, .45);
  background: rgba(255, 77, 110, .18);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-neu-danger:hover {
  background: rgba(255, 77, 110, .26);
  color: var(--text);
}

/* =========================
   Locations – Bootstrap modal (dark) [delete]
   ========================= */
#locDeleteModal .modal-content {
  background: rgba(18, 26, 38, 0.98);
  color: rgba(235, 242, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
}

#locDeleteModal .modal-header,
#locDeleteModal .modal-footer {
  border-color: rgba(255, 255, 255, .10);
}

#locDeleteModal .btn-close {
  filter: invert(1);
  opacity: .85;
}

#locDeleteModal .form-label,
#locDeleteModal .form-text,
#locDeleteModal .form-check-label {
  color: rgba(235, 242, 255, 0.72);
}

#locDeleteModal .form-check-input {
  background-color: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .18);
}

#locDeleteModal .alert {
  border-color: rgba(255, 255, 255, .10);
}

/* =========================================================
   Bootstrap – Dark overrides (CrewCore)
   Evita "pantallas blancas" en tablas / alerts / modales
   ========================================================= */

/* Modal (Bootstrap) */
.modal-content {
  background: rgba(18, 26, 38, 0.98);
  color: rgba(235, 242, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
}

.modal-header,
.modal-footer {
  border-color: rgba(255, 255, 255, .10);
}

.modal .btn-close {
  filter: invert(1);
  opacity: .85;
}

.modal .form-label,
.modal .form-text,
.modal .form-check-label {
  color: rgba(235, 242, 255, 0.72);
}

.modal .form-control,
.modal .form-select,
.modal textarea.form-control {
  background: rgba(255, 255, 255, .06) !important;
  color: rgba(235, 242, 255, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, .10) !important;
}

.modal .form-control::placeholder,
.modal textarea.form-control::placeholder {
  color: rgba(231, 237, 246, .55);
}

.modal .form-control:focus,
.modal .form-select:focus,
.modal textarea.form-control:focus {
  background: rgba(255, 255, 255, .08) !important;
  border-color: rgba(108, 99, 255, .45) !important;
  box-shadow: 0 0 0 .2rem rgba(108, 99, 255, .18) !important;
}

/* Alerts (Bootstrap) */
.alert {
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .10);
  color: rgba(235, 242, 255, 0.92);
  border-radius: 16px;
}

.alert a {
  color: rgba(235, 242, 255, 0.92);
  text-decoration: underline;
}

.alert-warning {
  background: rgba(255, 193, 7, .10);
  border-color: rgba(255, 193, 7, .20);
}

.alert-danger {
  background: rgba(255, 77, 110, .10);
  border-color: rgba(255, 77, 110, .20);
}

.alert-success {
  background: rgba(41, 197, 111, .10);
  border-color: rgba(41, 197, 111, .20);
}

.alert-info {
  background: rgba(47, 124, 255, .10);
  border-color: rgba(47, 124, 255, .20);
}

/* Tables (Bootstrap .table default) */
.table {
  --bs-table-bg: rgba(0, 0, 0, .14);
  --bs-table-striped-bg: rgba(255, 255, 255, .03);
  --bs-table-hover-bg: rgba(255, 255, 255, .05);
  --bs-table-border-color: rgba(255, 255, 255, .08);
  color: rgba(235, 242, 255, 0.92);
}

.table> :not(caption)>*>* {
  background-color: transparent;
  /* usa variables de bootstrap */
  border-color: rgba(255, 255, 255, .08);
}

.table thead th {
  color: rgba(235, 242, 255, 0.92);
  border-bottom-color: rgba(255, 255, 255, .10);
}

.table tbody td {
  color: rgba(235, 242, 255, 0.88);
}

/* Dropdowns (Bootstrap) */
.dropdown-menu {
  background: rgba(18, 26, 38, 0.98);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  box-shadow: var(--shadow2);
}

.dropdown-item {
  color: rgba(235, 242, 255, 0.85);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(255, 255, 255, .06);
  color: rgba(235, 242, 255, 0.95);
}

/* Pagination (Bootstrap) */
.page-link {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .10);
  color: rgba(235, 242, 255, 0.85);
}

.page-link:hover {
  background: rgba(255, 255, 255, .08);
  color: rgba(235, 242, 255, 0.95);
}

.page-item.active .page-link {
  background: rgba(108, 99, 255, .22);
  border-color: rgba(108, 99, 255, .45);
  color: rgba(235, 242, 255, 0.95);
}

/* =========================
   Form selects (native) – dark
   Nota: el menú desplegable (options) depende del navegador; esto ayuda en la mayoría.
   ========================= */
select.form-control,
select.form-select {
  background: rgba(255, 255, 255, .06) !important;
  color: rgba(235, 242, 255, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, .10) !important;
}

select.form-control option,
select.form-select option,
select.form-control optgroup,
select.form-select optgroup {
  background-color: rgba(18, 26, 38, 0.98);
  color: rgba(235, 242, 255, 0.92);
}

/* =========================================================
   CrewCore – Responsive (mobile + large desktop)
   Targets: iPhone 15 / Galaxy S22 / Vivo X200 + 22–27" desktop
   ========================================================= */

/* Content now uses full available width - no max-width constraint */
/* If you want to limit width on ultra-wide monitors, uncomment and adjust: */
/*
.cc-page, .cc-card, .content, main{
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}
*/

/* Stack grids on small screens */
@media (max-width: 768px) {
  .cc-grid-2 {
    grid-template-columns: 1fr !important;
  }

  .d-flex {
    flex-wrap: wrap;
  }

  .btn,
  .btn-neu,
  .btn-neu-accent,
  .btn-neu-danger {
    min-height: 44px;
  }
}

/* Tables: keep usable on phones */
@media (max-width: 430px) {
  table.table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  table.table thead,
  table.table tbody,
  table.table tr {
    width: max-content;
  }

  table.table th,
  table.table td {
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 13px;
  }
}


/* === RESPONSIVE HOTFIX v4 (dashboard/topbar/grids) === */
/* Asegura que las grids del dashboard se apilen en móvil (por orden/cascada y overrides) */
@media (max-width: 600px) {
  .cc-kpi-grid-4 {
    grid-template-columns: 1fr !important;
  }

  .cc-grid-2-1 {
    grid-template-columns: 1fr !important;
  }

  .cc-kpi-grid-4>* {
    width: 100%;
    min-width: 0;
  }

  .cc-grid-2-1>* {
    width: 100%;
    min-width: 0;
  }

  /* Topbar: cleanup */
  .cc-topbar {
    align-items: center;
  }

  .cc-topbar .btn-cc-scan {
    width: auto;
  }

  .cc-top-pills {
    display: flex !important;
    gap: 5px;
  }

  .cc-pill {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* Un poco menos de padding para ganar ancho útil */
  .cc-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .cc-shell {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
}


/* === RESPONSIVE HOTFIX v6 (inventory mobile) === */
@media (max-width: 600px) {

  /* INVENTORY: tabs y chips no deben forzar overflow */
  .inv-tabs,
  .inv-chips {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 6px;
  }

  .inv-tabs::-webkit-scrollbar,
  .inv-chips::-webkit-scrollbar {
    height: 6px;
  }

  .inv-tab,
  .inv-chip {
    flex: 0 0 auto;
  }

  /* INVENTORY: buscador (tiene max-width inline, lo anulamos) */
  #q,
  #category,
  #status {
    max-width: none !important;
    width: 100% !important;
  }

  /* Botonera: que haga wrap y no se salga */
  #btnSearch,
  #btnReset,
  #btnScan,
  #btnNewItem {
    flex: 1 1 auto;
    min-width: 120px;
  }

  /* Lista/grid no debe causar scroll horizontal */
  .cc-card.inv-classic {
    overflow-x: hidden;
  }

  .cc-inv-grid {
    grid-template-columns: 1fr !important;
    /* <- clave para móvil */
  }

  .cc-inv-grid,
  .cc-inv-list {
    min-width: 0;
  }
}


/* === RESPONSIVE HOTFIX v7 (kill horizontal overflow) === */
/* Evita tener que “arrastrar a la derecha” en móvil por cualquier min-width/transform */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 820px) {
  .cc-shell {
    width: 100%;
    overflow-x: hidden;
  }

  .cc-main {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .cc-card {
    max-width: 100%;
  }

  /* Acciones de inventario: wrap para que no ensanche filas */
  .inv-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .inv-actions .inv-btn {
    flex: 0 0 auto;
  }
}


/* === RESPONSIVE HOTFIX v8 (inventory item titles visible on mobile) === */
@media (max-width: 600px) {

  /* INVENTORY item rows: asegura que el bloque de texto tenga espacio y no colapse */
  .inv-row,
  .inv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .inv-info,
  .inv-meta,
  .inv-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  .inv-title,
  .inv-name {
    display: block;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .inv-subtitle,
  .inv-loc {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .85;
    max-width: 100%;
  }

  /* Acciones a la derecha: que no se coman todo el ancho */
  .inv-actions {
    flex: 0 0 auto;
    max-width: 52%;
  }
}

/* =========================================================
   Containers – helpers (safe global)
   ========================================================= */
.cc-break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 600px) {

  /* Evita que cards empujen el ancho en grids */
  .card-neu,
  .cc-card,
  .cc-panel,
  .cc-main {
    max-width: 100%;
    min-width: 0;
  }
}

#cc-typing-indicator {
  font-style: italic;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5) !important;
  border-left: 2px solid var(--cc-accent);
  margin-left: 1.5rem;
  padding-left: 0.5rem;
  transition: all 0.3s ease;
}

/* Module Dashboard Icons */
.module-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.module-card:hover .module-icon-wrap {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.module-card:hover .module-icon-wrap i {
  filter: drop-shadow(0 0 10px currentColor);
}

.module-card.disabled {
  opacity: 0.5;
  filter: grayscale(1);
  cursor: not-allowed;
}

.module-grid .module {
  transition: transform 0.2s ease;
}

.module-grid .module:hover {
  transform: translateY(-5px);
}

/* ERP Mobile & Layout Polish */
@media (max-width: 800px) {
  .cc-topbar {
    height: auto !important;
    min-height: 60px;
    flex-wrap: wrap;
    padding: 10px;
    gap: 8px;
  }

  .cc-search,
  .btn-cc-scan {
    display: none !important;
  }

  .cc-top-pills {
    margin-left: auto;
    width: auto;
  }

  .cc-pill {
    padding: 4px 10px;
    font-size: 11px;
  }

  .cc-top-pills .btn-cc-outline {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* ERP Header Stacking (Universal) */
  .container-fluid .d-flex.justify-content-between.mb-4.flex-wrap.gap-2 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
}

/* ERP Table Mobile Polish */
@media (max-width: 600px) {
  .table-responsive {
    border: 0;
    margin-bottom: 0;
  }

  .table-dark {
    font-size: 12px;
  }

  .table-dark td,
  .table-dark th {
    padding: 10px 8px !important;
  }

  /* Stacking action buttons if they are too many */
  .d-flex.gap-1.justify-content-end {
    flex-wrap: wrap;
    justify-content: flex-start !important;
    gap: 5px !important;
  }
}

/* ERP Ultra-Mobile Refinements */
@media (max-width: 500px) {
  .cc-content {
    padding: 8px !important;
  }

  .card-neu {
    padding: 12px 10px !important;
    border-radius: 14px !important;
  }

  h1.mb-1 {
    font-size: 1.4rem !important;
  }

  .text-neu-muted {
    font-size: 0.85rem !important;
  }

  /* Tables should use full width */
  .table-responsive {
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
    border-radius: 0;
  }
}

/* ✅ STACKABLE TABLES (Holded Style Mobile) */
@media (max-width: 768px) {
  .stackable-mobile {
    border: 0 !important;
  }

  .stackable-mobile thead {
    display: none;
  }

  .stackable-mobile tr {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 15px;
    padding: 12px;
  }

  .stackable-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 0 !important;
    padding: 6px 0 !important;
    width: 100% !important;
    text-align: left !important;
  }

  .stackable-mobile td::before {
    content: attr(data-label);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--muted);
    margin-right: 15px;
  }

  .stackable-mobile td:first-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding-bottom: 10px !important;
    margin-bottom: 8px;
    display: block;
  }

  .stackable-mobile td:first-child::before {
    margin-bottom: 4px;
    display: block;
  }

  /* Final row actions in edit pages */
  .stackable-mobile td:last-child {
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    margin-top: 8px;
    padding-top: 10px !important;
  }
}

@media (max-width: 600px) {
  .w-100-mobile {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .btn-neu-accent.w-100-mobile {
    display: block;
    text-align: center;
  }
}

/* ✅ REFINED MOBILE TABLES - Fix for Inputs & Overflow */
@media (max-width: 768px) {

  /* Make the card stand out more */
  .stackable-mobile tr {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    padding: 16px;
  }

  /* Adjust cell spacing */
  .stackable-mobile td {
    padding: 10px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    gap: 15px;
    /* Space between label and content */
  }

  /* Label Styling - Fixed width for alignment if possible, distinct color */
  .stackable-mobile td::before {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    min-width: 80px;
    /* Ensure labels align somewhat */
  }

  /* Fix for Inputs inside these tables (Budget/Invoice Edit) */
  .stackable-mobile td input.form-control,
  .stackable-mobile td select.form-select {
    text-align: right;
    /* Values right aligned like cards */
    width: auto;
    flex: 1;
    /* Take remaining space */
    min-width: 0;
    /* Allow shrinking */
    max-width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: white;
  }

  /* When focusing input, show border */
  .stackable-mobile td input.form-control:focus,
  .stackable-mobile td select.form-select:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
  }

  /* Actions Row - clean up */
  .stackable-mobile td:last-child {
    border-bottom: 0 !important;
    justify-content: flex-end;
    /* Align icons to right */
    padding-top: 15px !important;
  }

  /* Remove borders from the last visible cell before actions if needed */
  .stackable-mobile tr td:nth-last-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }
}

/* 🛠️ ULTRA-ROBUST MOBILE STACKED TABLES */
@media (max-width: 768px) {
  .stackable-mobile {
    display: block !important;
    width: 100% !important;
    table-layout: auto !important;
    border: none !important;
  }

  .stackable-mobile tbody,
  .stackable-mobile tr {
    display: block !important;
    width: 100% !important;
  }

  .stackable-mobile td {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between !important;
    align-items: center;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
    /* Prevent child overflow */
  }

  /* Ensure content on the right doesn't push the label out */
  .stackable-mobile td>div,
  .stackable-mobile td>span,
  .stackable-mobile td>input {
    max-width: 65% !important;
    word-break: break-word;
    text-align: right;
  }

  /* Special case for actions with many buttons */
  .stackable-mobile td[data-label="Acciones"],
  .stackable-mobile td:last-child {
    justify-content: flex-end !important;
    gap: 8px;
    flex-wrap: wrap;
  }

  .stackable-mobile td[data-label="Acciones"]>div {
    max-width: 100% !important;
    justify-content: flex-end;
  }

  /* Force table-responsive to not scroll if we are stacked */
  .card-neu>.table-responsive {
    overflow-x: hidden !important;
    margin: 0 !important;
    width: 100% !important;
  }
}

/* ✅ PRINT FIX GLOBAL */
@media print {

  html,
  body,
  .cc-shell,
  .cc-main,
  .cc-content {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    display: block !important;
  }

  .cc-sidebar,
  .cc-topbar,
  .cc-hamburger,
  #soni-container,
  #soniChatWindow,
  .no-print {
    display: none !important;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
  }
}