:root {
  --bg-deep: #040507;
  --bg-obsidian-radial: radial-gradient(circle at 50% -10%, rgb(20, 21, 27) 0%, rgb(13, 14, 19) 35%, rgb(7, 8, 11) 68%, rgb(4, 5, 7) 100%);
  --bg-surface: rgba(255, 255, 255, 0.02);
  --bg-surface-hover: rgba(255, 255, 255, 0.045);
  --bg-glass: rgba(15, 17, 23, 0.88);
  --bg-input: rgba(255, 255, 255, 0.035);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(56, 189, 248, 0.55);

  --yellow-primary: #38BDF8;
  --yellow-soft: rgba(56, 189, 248, 0.12);
  --yellow-border: rgba(56, 189, 248, 0.45);
  --yellow-glow: rgba(56, 189, 248, 0.18);

  --text-main: #f1f4fa;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --green-border: rgba(16, 185, 129, 0.32);

  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --red-border: rgba(239, 68, 68, 0.34);

  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.12);
  --blue-border: rgba(56, 189, 248, 0.32);

  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.12);
  --purple-border: rgba(167, 139, 250, 0.32);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image: var(--bg-obsidian-radial);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  overflow-x: hidden;
}

.tabular-nums { font-variant-numeric: tabular-nums; }
.mono { font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace; }
.hidden { display: none !important; }

/* Superficies sutiles solo para modales y tarjetas de formulario */
.liquid-glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

/* ============================================================================
   ICONOS & LOGO DE MARCA
============================================================================ */
.sc-ico { width: 15px; height: 15px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.sc-ico-sm { width: 14px; height: 14px; }
.sc-ico-lg { width: 19px; height: 19px; }

.brand-logo-img { display: block; object-fit: contain; user-select: none; pointer-events: none; }
.brand-logo-header { height: 38px; width: auto; }
.brand-logo-login { height: 68px; width: auto; margin: 0 auto 14px; }
.brand-logo-print { height: 42px; width: auto; }

/* ============================================================================
   LOGIN
============================================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--bg-deep);
  background-image: var(--bg-obsidian-radial);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 30px 28px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-logo-box { text-align: center; margin-bottom: 26px; }

.login-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.login-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 9px 13px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group select option { background: #0e1017; color: #ffffff; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
}

.btn-primary-gold {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--yellow-primary);
  color: #050608;
  border: none;
  border-radius: 9999px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
}

.btn-primary-gold:hover { filter: brightness(1.06); }
.btn-primary-gold:active { transform: scale(0.985); }

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-pill:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); }

.btn-pill-yellow {
  background: var(--yellow-primary);
  color: #050608;
  border-color: var(--yellow-primary);
  font-weight: 800;
}

.btn-pill-yellow:hover { background: #fff04d; border-color: #fff04d; }

.error-msg {
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  color: #fca5a5;
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  text-align: center;
}

.login-footer-hint { margin-top: 16px; text-align: center; font-size: 11px; color: var(--text-dim); }

/* ============================================================================
   TOP BAR & LEFT CIRCULAR RAIL — ABIERTOS SOBRE EL FONDO (COMO EL SOFTWARE)
============================================================================ */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-header-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.header-sub-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.header-sub-title > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-version-pill {
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.22);
  font-size: 11.5px;
  font-weight: 600;
  color: #6ee7b7;
  white-space: nowrap;
}

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.btn-header-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-header-icon:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }
.btn-header-logout { color: #fca5a5; border-color: rgba(239, 68, 68, 0.24); background: rgba(239, 68, 68, 0.07); }
.btn-header-logout:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.45); }
.btn-header-bell { position: relative; }
.btn-header-bell.has-unread { border-color: rgba(56, 189, 248, 0.48); color: #38BDF8; background: rgba(56, 189, 248, 0.08); }
.bell-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #38BDF8;
  color: #050608;
  font-size: 10.5px;
  font-weight: 800;
}

.workspace-shell {
  display: flex;
  flex: 1;
  gap: 20px;
  padding: 14px 24px 32px 16px;
  align-items: flex-start;
}

/* RIEL VERTICAL SIN CAJA NI MARCO (BOTONES CIRCULARES FLOTANDO LIBRES) */
.left-rail {
  width: 72px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.left-rail::-webkit-scrollbar { display: none; }

.rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.rail-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  transition: all 0.16s ease;
}

.rail-label {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  color: #8f92a8;
}

.rail-item:hover .rail-circle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.rail-item:hover .rail-label { color: #ffffff; }

.rail-item.active .rail-circle {
  background: rgba(56, 189, 248, 0.12);
  border: 1.5px solid rgba(56, 189, 248, 0.72);
  color: var(--yellow-primary);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.12);
}

.rail-item.active .rail-label { color: var(--yellow-primary); font-weight: 700; }

.rail-badge-dot {
  position: absolute;
  top: -1px;
  right: 11px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9999px;
  background: var(--red);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #050608;
}

.main-content {
  flex: 1;
  min-width: 0;
  max-width: 1560px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeSlide 0.16s ease-out; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   ENCABEZADOS Y MÉTRICAS ABIERTAS (SIN RECUADROS PESADOS)
============================================================================ */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.section-header p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.header-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.012);
}

.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1280px) { .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1050px) { .kpi-grid, .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-grid, .kpi-grid-5 { grid-template-columns: 1fr; } }

.kpi-card {
  padding: 16px 20px;
  position: relative;
  background: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.kpi-card:last-child { border-right: none !important; }

.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-label { font-size: 10.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.07em; }

.kpi-icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--yellow-primary);
}

.kpi-value { font-size: 25px; font-weight: 800; color: #ffffff; letter-spacing: -0.02em; line-height: 1.15; }
.kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

.text-green { color: #34d399; }
.text-blue { color: #38bdf8; }
.text-yellow { color: var(--yellow-primary); }
.text-red { color: #f87171; }
.text-purple { color: #c4b5fd; }
.text-muted { color: var(--text-muted); }

/* ============================================================================
   TABLAS ABIERTAS SOBRE EL LIENZO OSCURO (SIN RECUADROS PESADOS)
============================================================================ */
.surface-open {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 0 18px;
  margin-bottom: 18px;
}

.card-box {
  padding: 20px 22px;
  margin-bottom: 18px;
}

.box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.box-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-count {
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: 9999px;
  color: var(--text-muted);
}

.table-responsive { width: 100%; overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.data-table th {
  padding: 11px 12px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

.data-table td {
  padding: 15px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  color: var(--text-main);
  vertical-align: top;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.018);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-active { background: var(--green-soft); color: #34d399; border: 1px solid var(--green-border); }
.status-demo { background: var(--yellow-soft); color: var(--yellow-primary); border: 1px solid var(--yellow-border); }
.status-paused { background: var(--red-soft); color: #fca5a5; border: 1px solid var(--red-border); }
.status-off-gateway { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.34); }
.status-gateway { background: var(--blue-soft); color: #7dd3fc; border: 1px solid var(--blue-border); }
.status-pending-chip { background: rgba(148, 163, 184, 0.1); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.24); }

/* ============================================================================
   CLAVES Y EQUIPOS EN TABLA DE CLIENTES (LIMPIO, SIN CAJAS AMARILLAS PESADAS)
============================================================================ */
.client-keys-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

.key-inline-primary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.key-inline-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.key-dot-active {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow-primary);
  display: inline-block;
}

.key-meta-line {
  font-size: 11px;
  color: var(--text-muted);
}

/* Botonera circular estilo barra de herramientas del software */
.key-circle-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn-circle-tool {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-circle-tool:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
}

.btn-circle-tool.is-danger {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.28);
  color: #fca5a5;
}

.btn-circle-tool.is-danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.btn-circle-tool.is-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.btn-circle-tool.is-success:hover {
  background: var(--green);
  color: #050608;
}

.other-keys-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  padding: 2px 0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
}

.other-keys-toggle:hover { color: var(--yellow-primary); border-bottom-color: var(--yellow-primary); }

.other-keys-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-left: 10px;
  border-left: 1.5px solid rgba(255, 255, 255, 0.1);
}

.other-key-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.machine-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #dbe2f0;
  margin-bottom: 3px;
}

/* ACCIONES COMPACTAS EN TABLAS */
.actions-cell,
.lic-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.btn-table {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-pause { background: rgba(239, 68, 68, 0.09); color: #fca5a5; border-color: rgba(239, 68, 68, 0.28); }
.btn-pause:hover { background: var(--red); color: #ffffff; border-color: var(--red); }

.btn-resume { background: rgba(16, 185, 129, 0.1); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.btn-resume:hover { background: var(--green); color: #050608; border-color: var(--green); }

.btn-unbind:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.22); color: #ffffff; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #e2e8f0;
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

/* ============================================================================
   FILTROS Y BUSCADORES ESTILO PÍLDORA DEL SOFTWARE
============================================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 8px 14px 8px 36px;
  color: #ffffff;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}

.search-input:focus { border-color: var(--border-focus); background: rgba(255, 255, 255, 0.05); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.2); }
.chip.active { background: var(--yellow-soft); color: var(--yellow-primary); border-color: var(--yellow-border); font-weight: 700; }

/* ============================================================================
   GENERADOR DE LICENCIAS, MOLDES OTA & RELEASES
============================================================================ */
.generator-layout,
.molds-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 960px) { .generator-layout, .molds-layout { grid-template-columns: 1fr; } }

.duration-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.btn-duration {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-muted);
  padding: 9px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-duration.active { background: var(--yellow-soft); color: var(--yellow-primary); border-color: var(--yellow-border); font-weight: 700; }

.generated-key-display {
  border: 1px dashed var(--yellow-border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin: 12px 0;
  background: rgba(56, 189, 248, 0.025);
}

.key-label { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: var(--yellow-primary); margin-bottom: 8px; text-transform: uppercase; }
.key-code { font-size: 18px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: #ffffff; overflow-wrap: anywhere; }
.key-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 7px; }

.result-actions { display: flex; gap: 10px; margin-bottom: 14px; }

.btn-action-copy {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--yellow-primary);
  color: #050608;
  border: none;
  padding: 10px 16px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
}

.btn-action-whatsapp {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #25D366;
  color: #051b0e;
  border: none;
  padding: 10px 16px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
}

.info-callout {
  border-left: 2px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.04);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #bae6fd;
  line-height: 1.5;
}

.info-callout strong { color: #ffffff; display: block; margin-bottom: 2px; }

.form-row { display: flex; gap: 12px; }
@media (max-width: 640px) { .form-row { flex-direction: column; gap: 0; } }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.upload-dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 24px 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s ease;
}

.upload-dropzone:hover { border-color: var(--yellow-primary); background: rgba(56, 189, 248, 0.03); }

.drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--yellow-primary);
  margin-bottom: 8px;
}

.drop-text { font-size: 13px; font-weight: 600; color: #ffffff; }
.drop-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.mold-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mold-title { font-size: 13.5px; font-weight: 700; color: #ffffff; }
.mold-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: none;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] { width: auto; accent-color: var(--yellow-primary); }

.mold-queue-box { margin-top: 12px; border-top: 1px solid var(--border-subtle); padding-top: 10px; }
.mold-queue-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; color: var(--yellow-primary); }
.mold-queue-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.mold-queue-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 12px; }
.mold-queue-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.mold-progress-wrap { margin-top: 12px; padding: 8px 0; }
.mold-progress-bar-bg { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.mold-progress-bar-fill { height: 100%; background: linear-gradient(90deg, #38BDF8, #10b981); transition: width 0.2s ease; }

/* ============================================================================
   CONTABILIDAD & SIMULADOR TRIBUTARIO (LIMPIO ESTILO TOOLBAR)
============================================================================ */
.tax-simulator-panel {
  padding: 14px 0 18px;
  margin-bottom: 16px;
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
}

.tax-controls-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
}

.tax-issuer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 1280px) {
  .tax-controls-grid { grid-template-columns: repeat(3, 1fr); }
  .tax-issuer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .tax-controls-grid, .tax-issuer-grid { grid-template-columns: 1fr; }
}

.tax-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.tax-field input,
.tax-field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9999px;
  padding: 7px 12px;
  color: #ffffff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

.tax-field select option { background: #0e1017; color: #ffffff; }
.tax-field input:focus, .tax-field select:focus { border-color: var(--border-focus); }

.accounting-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.accounting-select {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 7px 13px;
  color: #ffffff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

.accounting-select option { background: #0e1017; color: #ffffff; }

.acc-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 5px 12px;
  min-width: 0;
}

.acc-date-wrap span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
}

.accounting-date-input {
  background: transparent;
  border: none;
  padding: 0;
  color: #ffffff;
  font-size: 12px;
  font-family: inherit;
  color-scheme: dark;
  outline: none;
  min-width: 0;
  max-width: 100%;
}

.accounting-split-grid {
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: 24px;
}

@media (max-width: 1180px) { .accounting-split-grid { grid-template-columns: 1fr; } }

/* ============================================================================
   MODALES & TOAST
============================================================================ */
.sc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(2, 4, 8, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.sc-modal-card {
  width: 100%;
  max-width: 680px;
  padding: 24px 26px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  max-height: 92vh;
  overflow-y: auto;
}

.sc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.sc-modal-header h3 { font-size: 16.5px; font-weight: 800; color: #ffffff; }

.sc-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sc-modal-close:hover { color: #ffffff; background: rgba(255, 255, 255, 0.12); }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: rgba(14, 16, 22, 0.96);
  border: 1px solid var(--yellow-border);
  border-left: 3px solid var(--yellow-primary);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   CHECKLIST DE VARIABLES EN LA NUBE (RAILWAY) Y DIAGNÓSTICO
   ============================================================================ */
.admin-diag-bar {
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.admin-test-email-input {
  width: 220px;
  padding: 6px 12px;
}

/* ============================================================================
   RESPONSIVE MÓVIL COMPLETO (CELULARES Y TABLETS)
   ============================================================================ */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .workspace-shell {
    flex-direction: column;
    padding: 12px 12px calc(104px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
  }

  .left-rail {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: none;
    z-index: 80;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 6px;
    padding: 9px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(8, 9, 13, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .rail-item {
    width: auto;
    min-width: 72px;
    flex: 0 0 auto;
    padding: 2px 6px;
    scroll-snap-align: center;
  }

  .rail-circle { width: 40px; height: 40px; }
  .rail-label { font-size: 10px; white-space: nowrap; }
  .rail-badge-dot { top: 0; right: 14px; }

  .top-header-bar {
    padding: 0 12px;
    height: 54px;
    gap: 8px;
  }

  .brand-logo-header { height: 22px; }
  .header-sub-title, .header-divider, .sync-pill { display: none; }

  .btn-header-icon {
    padding: 7px 12px;
    font-size: 12px;
    min-height: 36px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-header h2 { font-size: 18px; }

  .header-actions-row {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-actions-row .btn-pill,
  .header-actions-row .btn-secondary {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 40px;
  }

  /* Evitar auto-zoom en iOS Safari y mejorar área táctil en formularios */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  select,
  textarea,
  .search-input,
  .accounting-select {
    font-size: 16px !important;
    min-height: 40px;
  }

  .admin-test-email-input {
    width: 100%;
    flex: 1 1 180px;
  }

  .search-input-wrap {
    min-width: 0;
    flex: 1 1 100%;
  }

  .filter-chips {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .chip {
    min-height: 36px;
    padding: 6px 14px;
    flex: 0 0 auto;
  }

  /* Tablas convertidas a tarjetas verticales en celular (sin scroll horizontal incómodo) */
  .table-responsive {
    overflow-x: visible;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr {
    display: block;
    width: 100%;
  }

  .data-table tbody tr {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    padding: 10px 14px;
    margin-bottom: 10px;
  }

  .data-table tbody tr:hover td {
    background: transparent;
  }

  .data-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px 0;
    font-size: 12.5px;
    text-align: right;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .data-table td:last-child {
    border-bottom: none;
    padding-bottom: 2px;
  }

  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 34%;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    padding-top: 2px;
  }

  .data-table td.td-empty,
  .data-table td[colspan] {
    display: block;
    text-align: center;
    border-bottom: none;
  }

  .data-table td.td-empty::before,
  .data-table td[colspan]::before {
    display: none;
  }

  .data-table td.td-stacked {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 5px;
  }

  .data-table td.td-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    text-align: left;
    gap: 8px;
  }

  .data-table td.td-stacked::before,
  .data-table td.td-actions::before {
    flex: 0 0 100%;
    width: 100%;
    padding-top: 0;
  }

  .row-actions,
  .data-table td.td-actions .row-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn-table {
    min-height: 38px;
    padding: 6px 12px;
    font-size: 12px;
    flex: 1 1 auto;
    justify-content: center;
  }

  .btn-circle-tool,
  .data-table td.td-actions .btn-circle-tool {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-self: flex-start;
  }

  .client-keys-stack {
    min-width: 0;
    width: 100%;
  }

  .toast {
    bottom: 86px;
    left: 12px;
    right: 12px;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .kpi-grid,
  .kpi-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
  }

  .kpi-card {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  .kpi-card:nth-child(2n) {
    border-right: none !important;
  }

  .kpi-grid-5 .kpi-card:last-child {
    grid-column: 1 / -1;
    border-right: none !important;
  }

  .kpi-value { font-size: 19px; }

  .accounting-filters-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .accounting-filters-bar .search-input-wrap,
  #btnClearAccFilters {
    grid-column: 1 / -1;
    width: 100%;
  }

  .accounting-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-overflow: ellipsis;
    padding: 8px 12px;
  }

  .acc-date-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-radius: 14px;
    padding: 6px 10px;
    justify-content: space-between;
  }

  .accounting-date-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-align: right;
    -webkit-appearance: none;
    appearance: none;
  }

  .result-actions {
    flex-direction: column;
  }

  .sc-modal-backdrop {
    padding: 8px;
    align-items: flex-end;
  }

  .sc-modal-card {
    padding: 18px 16px;
    border-radius: 18px;
    max-height: 92svh;
  }

  .login-card {
    padding: 26px 20px 22px;
    border-radius: 18px;
  }
}

/* ============================================================================
   PROSPECCIÓN CRM, PERFILES DE EQUIPO Y RECORDATORIOS DE PRUEBA
   ============================================================================ */
.user-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  color: #e2e8f0;
  white-space: nowrap;
}

.user-role-tag {
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(56, 189, 248, 0.12);
  color: var(--yellow-primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.user-role-tag.is-agent {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.3);
}

.prospect-reminders-box {
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.03);
  padding: 14px 16px;
}

.prospect-reminders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.prospect-reminders-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.prospect-reminders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(12, 14, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--yellow-primary);
}

.reminder-item.sev-danger { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.06); }
.reminder-item.sev-warning { border-left-color: #38BDF8; background: rgba(56, 189, 248, 0.045); }
.reminder-item.sev-info { border-left-color: #38bdf8; background: rgba(56, 189, 248, 0.055); }

.reminder-main { min-width: 220px; flex: 1; }
.reminder-shop { font-size: 13px; font-weight: 700; color: #ffffff; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reminder-desc { font-size: 12px; color: #cbd5e1; margin-top: 3px; }
.reminder-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.wa-phone-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wa-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.34);
  color: #4ade80;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.wa-phone-link:hover {
  background: #25D366;
  color: #051b0e;
  border-color: #25D366;
}

.btn-mini-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.btn-mini-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-pitch-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.08);
  color: #38BDF8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-pitch-copy:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.65);
  color: #ffffff;
}

.btn-star-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #64748b;
  cursor: pointer;
  padding: 0;
  margin-right: 6px;
  vertical-align: middle;
  transition: all 0.15s ease;
}

.btn-star-toggle:hover {
  border-color: rgba(56, 189, 248, 0.55);
  color: #38BDF8;
}

.btn-star-toggle.starred {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.13);
  color: #38BDF8;
}

.btn-star-toggle.starred svg {
  fill: #38BDF8;
}

.potential-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.potential-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.potential-pill.tier-vip {
  background: rgba(56, 189, 248, 0.16);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.potential-pill.tier-top {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.36);
}

.potential-pill.tier-good {
  background: rgba(56, 189, 248, 0.11);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.potential-reasons {
  font-size: 10.5px;
  color: var(--text-muted);
}

.status-select-pill {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  min-width: 142px;
}

.status-select-pill option { background: #0e1017; color: #f8fafc; }
.status-select-pill.st-pendiente { border-color: rgba(148, 163, 184, 0.35); color: #cbd5e1; background: rgba(148, 163, 184, 0.08); }
.status-select-pill.st-contactado { border-color: rgba(56, 189, 248, 0.4); color: #7dd3fc; background: rgba(56, 189, 248, 0.1); }
.status-select-pill.st-pidio_prueba { border-color: rgba(56, 189, 248, 0.55); color: #38BDF8; background: rgba(56, 189, 248, 0.11); }
.status-select-pill.st-prueba_activa { border-color: rgba(16, 185, 129, 0.5); color: #34d399; background: rgba(16, 185, 129, 0.12); }
.status-select-pill.st-prueba_vencida { border-color: rgba(245, 158, 11, 0.5); color: #fbbf24; background: rgba(245, 158, 11, 0.12); }
.status-select-pill.st-comprado { border-color: rgba(16, 185, 129, 0.7); color: #6ee7b7; background: rgba(16, 185, 129, 0.22); }
.status-select-pill.st-no_interesado { border-color: rgba(239, 68, 68, 0.42); color: #fca5a5; background: rgba(239, 68, 68, 0.11); }

.bulk-assign-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.team-assignee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.02);
}

.unassigned-city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-table .col-owner-only.hidden {
  display: none !important;
}

.prospect-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--text-muted);
}

.prospect-pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 1220px) {
  .header-divider,
  .header-sub-title {
    display: none;
  }
}

@media (max-width: 768px) {
  .user-profile-pill { display: none; }
  .header-left-group { flex: 0 0 auto; }
  .header-right-group { flex: 1 1 auto; min-width: 0; justify-content: flex-end; gap: 6px; }
  .status-select-pill { width: 100%; min-width: 0; }
  .wa-phone-row { justify-content: flex-end; }
}

@media (max-width: 560px) {
  #btnRefreshAll span,
  #btnLogout span {
    display: none;
  }
  #btnRefreshAll,
  #btnLogout {
    padding: 7px 10px;
  }
  .btn-header-bell {
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

@media print {
  body { background: #ffffff !important; color: #0f172a !important; }
  .top-header-bar, .left-rail, .no-print, .sc-modal-close { display: none !important; }
  .liquid-glass-panel, .surface-open, .card-box, .kpi-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
  }
  .kpi-value, .data-table td, .data-table th, .section-header h2, .box-header h4 { color: #0f172a !important; }
  body.printing-single-receipt #appContainer { display: none !important; }
  body.printing-single-receipt #modalSaleReceipt {
    position: static !important;
    background: #ffffff !important;
    padding: 0 !important;
  }
  body.printing-single-receipt #modalSaleReceipt .sc-modal-card {
    max-width: 100% !important;
    max-height: none !important;
    border: none !important;
  }
}
