/* =========================================================================
   PANEL OPERATIVO — Millenium PBX Cloud Hub
   -------------------------------------------------------------------------
   Depende de theme.css, que debe cargarse ANTES que este archivo: alli viven
   todos los tokens (color, tipografia, radios, sombras). Aqui no debe
   aparecer ningun color literal; si hace falta uno nuevo, se agrega como
   token en theme.css.

   Criterio visual: minimalismo denso. La jerarquia la dan el peso
   tipografico, el espaciado y los bordes de 1px — no las sombras, los
   degradados ni los brillos. El rojo de marca aparece solo en lo accionable.
   ========================================================================= */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* =========================================================================
   1. PIEZAS PROPIAS DEL PANEL OPERATIVO
   -------------------------------------------------------------------------
   La barra superior y el mega-menu viven en shell.css (compartidos con el
   Super Admin). Aqui solo queda lo que es exclusivo de este panel.
   ========================================================================= */
/* Fila del cliente en el que se está operando ahora mismo */
.cliente-row-active td {
  background: var(--brand-soft);
}

.tag-current {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  margin-left: var(--sp-2);
}

/* =========================================================================
   3. LAYOUT PRINCIPAL Y TARJETAS DE METRICA
   ========================================================================= */
.main-content {
  flex: 1;
  padding: var(--sp-6);
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn var(--dur-base) var(--ease);
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.category-group-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-2);
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: var(--ls-tight);
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: border-color var(--dur-bounce) var(--ease-bounce),
              box-shadow var(--dur-bounce) var(--ease-bounce),
              transform var(--dur-bounce) var(--ease-bounce);
}

.metric-card:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.metric-card:hover .metric-icon i,
.metric-card:hover .metric-icon svg {
  animation: icon-bounce var(--dur-bounce) var(--ease-bounce);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.metric-title {
  font-size: var(--fs-2xs);
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-base);
  flex-shrink: 0;
  line-height: 1;
}

/* Fichas de color por modulo. El tinte se calcula sobre el token de cada
   tema, asi que funcionan igual en claro, oscuro y tokyo. */
.icon-purple { background: color-mix(in srgb, var(--cat-5) 14%, transparent); color: var(--cat-5); }
.icon-green  { background: color-mix(in srgb, var(--cat-3) 14%, transparent); color: var(--cat-3); }
.icon-amber  { background: color-mix(in srgb, var(--cat-4) 14%, transparent); color: var(--cat-4); }
.icon-pink   { background: color-mix(in srgb, var(--cat-1) 14%, transparent); color: var(--cat-1); }
.icon-blue   { background: color-mix(in srgb, var(--cat-2) 14%, transparent); color: var(--cat-2); }
.icon-cyan   { background: color-mix(in srgb, var(--cat-6) 14%, transparent); color: var(--cat-6); }

.metric-value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  color: var(--text);
  line-height: 1.1;
  margin-bottom: var(--sp-1);
}

.text-amber { color: var(--cat-4); }
.text-green { color: var(--cat-3); }
.text-blue  { color: var(--cat-2); }
.text-pink  { color: var(--cat-1); }
.text-cyan  { color: var(--cat-6); }

.metric-subtitle {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* Panel Principal: tarjetas de acceso por microservicio */
.home-module-card {
  cursor: pointer;
}

.home-module-card:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--border));
}

.home-card-link {
  display: inline-block;
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--brand);
}

.home-module-card:hover .home-card-link {
  color: var(--brand-hover);
}

.module-check-yes { color: var(--success); font-size: var(--fs-base); }
.module-check-no  { color: var(--text-3); font-size: var(--fs-base); opacity: 0.55; }

/* Espacio en Disco PBX - Tarjeta Home */
.storage-kpi-display {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.storage-kpi-used {
  font-size: 1.55rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.storage-kpi-divider {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-3);
  opacity: 0.6;
}
.storage-kpi-total {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-3);
}
.storage-kpi-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.storage-kpi-bar {
  width: 100%;
  height: 6px;
  background: color-mix(in srgb, var(--text-3) 15%, transparent);
  border-radius: 999px;
  overflow: hidden;
}
.storage-kpi-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.storage-kpi-fill.storage-ok {
  background: #10b981;
}
.storage-kpi-fill.storage-warning {
  background: #f59e0b;
}
.storage-kpi-fill.storage-danger {
  background: #ef4444;
}
.storage-kpi-details {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
}
.storage-kpi-pct {
  font-weight: 600;
}
.storage-kpi-pct.storage-ok {
  color: #10b981;
}
.storage-kpi-pct.storage-warning {
  color: #f59e0b;
}
.storage-kpi-pct.storage-danger {
  color: #ef4444;
}
.storage-kpi-dot {
  opacity: 0.45;
}
.storage-kpi-free {
  font-weight: 500;
}

/* Centro de Alarmas - Tarjeta Home */
.alarms-kpi-display {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.alarms-kpi-count {
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}
.alarms-kpi-display.clean .alarms-kpi-count {
  color: #10b981;
}
.alarms-kpi-display.warning .alarms-kpi-count {
  color: #f59e0b;
}
.alarms-kpi-display.critical .alarms-kpi-count {
  color: #ef4444;
}
.alarms-kpi-label {
  font-size: 0.88rem;
  font-weight: 600;
}
.alarms-kpi-display.clean .alarms-kpi-label {
  color: #10b981;
}
.alarms-kpi-display.warning .alarms-kpi-label {
  color: #f59e0b;
}
.alarms-kpi-display.critical .alarms-kpi-label {
  color: #ef4444;
}
.alarms-kpi-sub {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
}
.pulse-dot-green {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
  flex-shrink: 0;
}
.pulse-dot-amber {
  width: 7px;
  height: 7px;
  background-color: #f59e0b;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulse-amber 2s infinite;
  flex-shrink: 0;
}
.pulse-dot-red {
  width: 7px;
  height: 7px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulse-red 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulse-amber {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* =========================================================================
   4. BARRA DE HERRAMIENTAS Y FILTROS
   ========================================================================= */
.cb-toolbar,
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.cb-toolbar-filters {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  flex: 1;
}

.cb-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 220px;
  flex: 1;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: var(--fs-sm);
  pointer-events: none;
}

.search-input,
.select-input,
.select-input-styled {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  padding: 0.45rem 0.7rem;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.search-input { padding-left: 2rem; }

.select-input,
.select-input-styled {
  width: auto;
  cursor: pointer;
}

.search-input::placeholder { color: var(--text-3); }

.search-input:hover,
.select-input:hover,
.select-input-styled:hover {
  border-color: var(--border-strong);
}

.search-input:focus,
.select-input:focus,
.select-input-styled:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: var(--ring);
}

/* Botones de filtro tipo segmento (supervision) */
.sup-filter-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-full);
  padding: 0.32rem 0.8rem;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sup-filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.sup-filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}

/* =========================================================================
   5. CALLBACK — COLUMNAS Y TARJETAS DE LLAMADA
   ========================================================================= */
.cb-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  align-items: start;
}

@media (max-width: 1100px) {
  .cb-columns-grid { grid-template-columns: 1fr; }
}

.cb-column-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cb-column-header {
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Un filete de color arriba identifica la columna sin tenir todo el bloque */
.cb-header-pending  { box-shadow: inset 0 2px 0 var(--warning); }
.cb-header-completed { box-shadow: inset 0 2px 0 var(--success); }

.cb-column-title-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.cb-column-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 650;
  color: var(--text);
  letter-spacing: var(--ls-tight);
}

.badge-counter {
  font-size: var(--fs-2xs);
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  line-height: 1.5;
}

.badge-amber {
  background: color-mix(in srgb, var(--warning) 15%, transparent);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
}

.badge-green {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.btn-page {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-xs);
  width: 24px;
  height: 24px;
  font-size: var(--fs-2xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-page:hover:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-indicator {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-3);
  padding: 0 var(--sp-1);
}

.cb-cards-container {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 720px;
  overflow-y: auto;
}

.cb-call-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

.cb-call-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.cb-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

/* El numero es el identificador que mas se escanea: maximo peso, sin color */
.cb-card-phone {
  font-size: var(--fs-lg);
  font-weight: 650;
  color: var(--text);
  letter-spacing: var(--ls-tight);
}

.cb-time-ago {
  font-size: var(--fs-xs);
  color: var(--text-3);
  white-space: nowrap;
}

.cb-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.cb-meta-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.cb-badge-attempt {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-2xs);
  font-weight: 600;
  background: color-mix(in srgb, var(--cat-2) 13%, transparent);
  color: var(--cat-2);
  border: 1px solid color-mix(in srgb, var(--cat-2) 26%, transparent);
}

.cb-badge-scheduled {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-2xs);
  font-weight: 600;
  background: color-mix(in srgb, var(--cat-5) 13%, transparent);
  color: var(--cat-5);
  border: 1px solid color-mix(in srgb, var(--cat-5) 26%, transparent);
  margin-bottom: var(--sp-2);
}

.cb-notes-box {
  background: var(--surface-inset);
  border-left: 2px solid var(--brand);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-xs);
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-bottom: var(--sp-3);
  line-height: var(--lh-base);
  white-space: pre-wrap;
}

.cb-notes-box.notes-completed {
  border-left-color: var(--success);
}

.cb-call-history {
  margin-bottom: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.cb-call-history summary {
  cursor: pointer;
  color: var(--brand);
}

.cb-call-history ul {
  margin: var(--sp-2) 0 0 0;
  padding-left: var(--sp-4);
  color: var(--text-muted);
}

.cb-card-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--sp-3);
  flex-wrap: wrap;
}

/* Verde = iniciar llamada; convencion de telefonia, se mantiene */
.btn-call {
  background: var(--success);
  color: var(--text-inverse);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  transition: var(--transition);
}

.btn-call:hover {
  filter: brightness(1.08);
}

.btn-tipificar {
  background: var(--brand);
  color: var(--brand-contrast);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  transition: var(--transition);
}

.btn-tipificar:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-revert {
  background: transparent;
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 32%, transparent);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-revert:hover {
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}

/* Estado vacio: emoji grande al 50% de opacidad y una frase que dice que
   hacer, no solo que no hay nada. */
.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.empty-state > span:first-child {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
  opacity: 0.5;
  margin-bottom: var(--sp-3);
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* =========================================================================
   6. GRAFICOS
   ========================================================================= */
.charts-2col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
}

@media (max-width: 900px) {
  .charts-2col-grid { grid-template-columns: 1fr; }
}

.chart-box-title {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: var(--sp-4);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.chart-canvas-container {
  position: relative;
  width: 100%;
}

/* =========================================================================
   7. SECCIONES, TABLAS Y MODALES
   ========================================================================= */
/* Los paneles van ELEVADOS y los campos de formulario hundidos: esa inversion
   es lo que hace que un panel se lea como algo que se lee y un formulario como
   algo donde se escribe. */
.card-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
  box-shadow: var(--shadow-xs);
}

/* El encabezado de un panel es SIEMPRE una barra con linea inferior: titulo
   con su emoji a la izquierda, accion primaria a la derecha. Sin excepciones. */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 650;
  letter-spacing: var(--ls-tight);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Botones: degradado a 135 grados + resplandor del propio color, nunca una
   sombra negra dura. El scale(0.94) al pulsar es exagerado a proposito y dura
   80ms: da una sensacion fisica de clic que el :hover por si solo no logra. */
.btn-action {
  background: linear-gradient(135deg, var(--brand-hover) 0%, var(--brand) 100%);
  color: var(--brand-contrast);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.45rem 0.95rem;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  box-shadow: 0 4px 14px var(--brand-glow);
  transition: var(--transition-bounce);
}

.btn-action:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px var(--brand-glow);
  filter: brightness(1.08);
}

.btn-action:hover i.fa-sync, 
.btn-action:hover i.fa-sync-alt {
  animation: spin-slow 1s linear infinite;
}

.btn-action:hover i:not(.fa-sync):not(.fa-sync-alt) {
  animation: icon-bounce var(--dur-bounce) var(--ease-bounce);
}

.btn-action:active {
  transform: translateY(1px) scale(0.94);
  transition: transform 80ms var(--ease-bounce);
}

.btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--glass);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.95rem;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: var(--transition-bounce);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-2px) scale(1.02);
}

.btn-secondary:hover i.fa-sync, 
.btn-secondary:hover i.fa-sync-alt {
  animation: spin-slow 1s linear infinite;
}

.btn-secondary:hover i:not(.fa-sync):not(.fa-sync-alt) {
  animation: icon-bounce var(--dur-bounce) var(--ease-bounce);
}

.btn-secondary:active {
  transform: translateY(1px) scale(0.94);
  transition: transform 80ms var(--ease-bounce);
}

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

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--fs-sm);
}

.custom-table th {
  background: var(--surface-2);
  color: var(--text-3);
  font-weight: 600;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  white-space: nowrap;
}

.custom-table th:first-child { border-top-left-radius: var(--radius-sm); }
.custom-table th:last-child  { border-top-right-radius: var(--radius-sm); }

.custom-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-2);
  vertical-align: middle;
}

.custom-table tr:last-child td { border-bottom: none; }

.custom-table tr {
  transition: transform var(--dur-base) var(--ease);
}

.custom-table tr:hover td {
  background: var(--surface-hover);
}

.custom-table tr:hover {
  transform: translateX(4px);
}

.custom-table code {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.08rem 0.35rem;
  color: var(--text);
}

/* --- Modales --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--sp-5);
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  padding: var(--sp-6);
  box-shadow: var(--shadow-lg);
  /* Frenada larga y suave, distinta del rebote de los botones: una ventana
     que rebota al abrirse se siente inestable. */
  animation: modalScale var(--dur-modal) var(--ease-modal);
  margin: auto;
}

.modal-sm { max-width: 420px; }

@keyframes modalScale {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 650;
  letter-spacing: var(--ls-tight);
  color: var(--text);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  padding: var(--sp-1);
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.btn-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.form-group { margin-bottom: var(--sp-4); }

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

@media (max-width: 600px) {
  .form-row-2col { grid-template-columns: 1fr; }
}

.form-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}

.form-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  padding: 0.55rem 0.75rem;
  font-size: var(--fs-md);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.form-input::placeholder { color: var(--text-3); }

.form-input:hover { border-color: var(--border-strong); }

.form-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: var(--ring);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: var(--lh-base);
}

.text-highlight {
  color: var(--brand);
  font-weight: 700;
  font-size: var(--fs-lg);
}

.form-checkbox-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.radio-options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.radio-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-2);
  transition: var(--transition);
}

.radio-card:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.radio-card input[type="radio"],
.radio-card input[type="checkbox"] {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  margin-top: 2px;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

.code-box {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--terminal-text);
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.copy-btn {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.55rem;
  font-family: inherit;
  font-size: var(--fs-2xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}

.code-box .copy-btn {
  background: color-mix(in srgb, var(--terminal-text) 12%, transparent);
  border-color: color-mix(in srgb, var(--terminal-text) 22%, transparent);
  color: var(--terminal-text);
}

/* =========================================================================
   8. INSIGNIAS Y ETIQUETAS DE ESTADO
   ========================================================================= */
.badge,
.tag-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tag-online,
.status-completed {
  background: color-mix(in srgb, var(--success) 13%, transparent);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 26%, transparent);
}

.tag-offline {
  background: color-mix(in srgb, var(--text-3) 12%, transparent);
  color: var(--text-3);
  border-color: var(--border);
}

.tag-completed {
  background: color-mix(in srgb, var(--success) 13%, transparent);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 26%, transparent);
}

.badge-blue {
  background: color-mix(in srgb, var(--cat-2) 13%, transparent);
  color: var(--cat-2);
  border-color: color-mix(in srgb, var(--cat-2) 26%, transparent);
}

.badge-gray {
  background: color-mix(in srgb, var(--text-3) 12%, transparent);
  color: var(--text-3);
  border-color: var(--border);
}

/* =========================================================================
   9. CHAT / COPILOT IA
   ========================================================================= */
.chat-container {
  min-height: 360px;
  max-height: 480px;
  overflow-y: auto;
  padding: var(--sp-4);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.chat-bubble {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  max-width: 82%;
  animation: fadeIn var(--dur-base) var(--ease);
}

.bot-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  color: var(--text);
  border-bottom-left-radius: var(--radius-xs);
}

.user-bubble {
  background: var(--brand);
  color: var(--brand-contrast);
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-xs);
}

.bubble-header {
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--text-3);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.user-bubble .bubble-header {
  color: color-mix(in srgb, var(--brand-contrast) 78%, transparent);
}

.bubble-body {
  font-size: var(--fs-base);
  line-height: var(--lh-base);
}

.chip-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 35%, transparent);
  color: var(--brand);
}

/* =========================================================================
   10. PIE Y SELECTOR DE TEMA
   ========================================================================= */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-6);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* .theme-switch vive en shell.css (compartido entre los dos paneles) */

/* =========================================================================
   11. RESPONSIVE
   ========================================================================= */

@media (max-width: 1024px) {
  .main-content { padding: var(--sp-5); }

  .cb-toolbar-filters { flex: 1 1 100%; }
}

/* -------------------------------------------------------------------------
   Movil (<=900px): la barra deja de ser flex y pasa a rejilla con areas
   nombradas -- marca y grupo derecho comparten la primera fila, la navegacion
   ocupa la segunda a lo ancho con desplazamiento horizontal, y el contexto de
   central baja a la tercera.

   El truco: `display: contents` sobre el contenedor izquierdo. Hace que ese
   div desaparezca como caja y sus hijos se coloquen directamente en la
   rejilla de la cabecera -- reorganizacion completa sin duplicar HTML.

   Y el MISMO panel del mega-menu se convierte en hoja inferior: sube desde
   abajo en vez de caer desde arriba. Mismo marcado, mismo estado, otra
   presentacion.
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .main-content { padding: var(--sp-4); }

  .modal-card { padding: var(--sp-5); }

  .cb-toolbar,
  .filter-bar { justify-content: flex-start; }

  .cb-card-actions { justify-content: stretch; }

  .cb-card-actions button { flex: 1 1 auto; }
}

/* Telefono chico: se reduce densidad en vez de ocultar controles, para no
   perder funcionalidad. */
@media (max-width: 480px) {
  .btn-secondary,
  .btn-action {
    font-size: var(--fs-xs);
    padding: 0.4rem 0.6rem;
  }

  .main-content { padding: var(--sp-3); }

  /* WebPhone Integrado: el contenedor traia min-height:760px / min-height:680px
     fijos en pixeles (pensados para escritorio) que en un celular superan la
     altura visible real -- la ultima fila del teclado (*, 0, #) quedaba
     empujada fuera de pantalla, pegada al pie de pagina. Sin el piso fijo,
     height:80vh/100% se ajusta a la altura real disponible.
     !important es obligatorio aqui: ambos valores vienen de un atributo
     style="" inline en index.html, y un inline SIEMPRE le gana a una regla
     externa sin importar el selector (id, !important aparte). */
  #webrtc-webphone-panel {
    min-height: unset !important;
    height: 78vh !important;
  }

  #webrtc-webphone-frame-wrap {
    min-height: unset !important;
  }
}

/* Filtros de estado WebRTC */
.webrtc-filter-btn {
  background: var(--surface-1, #1e293b);
  border: 1px solid var(--border-color, #334155);
  color: var(--text-secondary, #94a3b8);
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.webrtc-filter-btn:hover {
  background: var(--surface-3, #334155);
  color: var(--text-primary, #f8fafc);
  border-color: var(--brand, #3b82f6);
}
.webrtc-filter-btn.active {
  background: var(--brand, #3b82f6);
  border-color: var(--brand, #3b82f6);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
}

/* =========================================================================
   ESTILOS PREMIUM: AUTO-PROVISIONING & ESCÁNER DE RED (SONAR RADAR)
   ========================================================================= */
.prov-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: var(--sp-3, 0.75rem);
  margin-bottom: var(--sp-4, 1rem);
}

.prov-kpi-card {
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 116px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.prov-kpi-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent-cyan) 40%, var(--border-color));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.prov-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--accent-cyan));
  opacity: 0.85;
}

.prov-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.prov-kpi-title {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.prov-kpi-icon {
  font-size: 1.15rem;
  opacity: 0.9;
}

.prov-kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.prov-kpi-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.45rem;
  line-height: 1.28;
  display: block;
  min-height: 2.5em;
}

/* Micro-Píldoras de Estado en la Flota Total */
.prov-kpi-substats {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
  min-height: 2.5em;
}

.prov-substat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.22rem 0.48rem;
  border-radius: var(--radius-full, 9999px);
  white-space: nowrap !important;
  letter-spacing: -0.01em;
  transition: all 0.15s ease;
  user-select: none;
}

.prov-substat-chip .prov-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prov-chip-provisioned {
  background: color-mix(in srgb, #10b981 12%, var(--surface-2));
  color: #047857;
  border: 1px solid color-mix(in srgb, #10b981 30%, transparent);
}
[data-theme="dark"] .prov-chip-provisioned {
  color: #34d399;
}
.prov-chip-provisioned .prov-chip-dot {
  background: #10b981;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.4);
}

.prov-chip-pending {
  background: color-mix(in srgb, #f59e0b 12%, var(--surface-2));
  color: #b45309;
  border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
}
[data-theme="dark"] .prov-chip-pending {
  color: #fbbf24;
}
.prov-chip-pending .prov-chip-dot {
  background: #f59e0b;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.4);
}

.prov-chip-online {
  background: color-mix(in srgb, var(--accent-cyan) 12%, var(--surface-2));
  color: var(--accent-cyan);
  border: 1px solid color-mix(in srgb, var(--accent-cyan) 30%, transparent);
}
.prov-chip-online .prov-chip-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}
.prov-chip-online .prov-chip-dot.pulse {
  animation: prov-pulse-dot 2s infinite ease-in-out;
}
@keyframes prov-pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

/* Chip compacto Zero-Touch DHCP Option 66 */
.prov-dhcp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  background: color-mix(in srgb, var(--accent-cyan) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-cyan) 35%, transparent);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.prov-dhcp-chip:hover {
  background: color-mix(in srgb, var(--accent-cyan) 22%, transparent);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}
.prov-dhcp-chip:active {
  transform: translateY(0);
}
.prov-dhcp-chip-icon {
  font-size: 0.9rem;
}
.prov-dhcp-chip-copy {
  font-size: 0.82rem;
  opacity: 0.7;
}

.prov-url-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  background: var(--surface-1);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  font-weight: 600;
  user-select: all;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Radar Sonar Visual */
.radar-sonar-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-cyan) 16%, transparent) 0%, var(--surface-1) 70%);
  border: 2px solid color-mix(in srgb, var(--accent-cyan) 45%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent-cyan) 25%, transparent), inset 0 0 16px color-mix(in srgb, var(--accent-cyan) 18%, transparent);
  overflow: hidden;
}

.radar-sonar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70px;
  height: 70px;
  transform-origin: top left;
  background: conic-gradient(from 0deg at 0% 0%, color-mix(in srgb, var(--accent-cyan) 65%, transparent) 0deg, color-mix(in srgb, var(--accent-cyan) 15%, transparent) 40deg, transparent 80deg);
  animation: radar-sweep 2.2s linear infinite;
}

.radar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--accent-cyan) 35%, transparent);
  pointer-events: none;
}

.radar-crosshair-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: color-mix(in srgb, var(--accent-cyan) 22%, transparent);
}

.radar-crosshair-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--accent-cyan) 22%, transparent);
}

.radar-center-blip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan, #06b6d4);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--accent-cyan, #06b6d4);
}

@keyframes radar-sweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pills de conteo del escáner */
.prov-pill-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.prov-pill-counter strong {
  color: var(--text-primary);
}

/* Agrupador de campos en modal */
.form-section-box {
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}

.form-section-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-highlight);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Badges de Estado de Aprovisionamiento (Píldoras Refinadas & Ultra-Legibles) */
.prov-status-pill,
.tag-prov-provisioned,
.tag-prov-pending,
.tag-prov-resync {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.38rem !important;
  padding: 0.22rem 0.65rem !important;
  border-radius: 9999px !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  user-select: none;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.prov-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.prov-status-text {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prov-status-date {
  font-size: 0.69rem;
  font-weight: 500;
  opacity: 0.85;
  padding-left: 0.35rem;
  border-left: 1px solid currentColor;
  margin-left: 0.1rem;
  white-space: nowrap;
}

/* 1. Aprovisionado (Verde Esmeralda) */
.prov-status-provisioned,
.tag-prov-provisioned {
  background: color-mix(in srgb, #10b981 12%, transparent) !important;
  color: #047857 !important;
  border: 1px solid color-mix(in srgb, #10b981 32%, transparent) !important;
}
[data-theme="dark"] .prov-status-provisioned,
[data-theme="dark"] .tag-prov-provisioned {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
.prov-status-provisioned .prov-status-dot,
.tag-prov-provisioned .prov-status-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

/* 2. Pendiente / Sin Descargar (Ámbar) */
.prov-status-pending,
.tag-prov-pending {
  background: color-mix(in srgb, #f59e0b 12%, transparent) !important;
  color: #b45309 !important;
  border: 1px solid color-mix(in srgb, #f59e0b 32%, transparent) !important;
}
[data-theme="dark"] .prov-status-pending,
[data-theme="dark"] .tag-prov-pending {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
.prov-status-pending .prov-status-dot,
.tag-prov-pending .prov-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

/* 3. Re-sync Requerido (Rosa / Magenta) */
.prov-status-resync,
.tag-prov-resync {
  background: color-mix(in srgb, #ec4899 12%, transparent) !important;
  color: #be185d !important;
  border: 1px solid color-mix(in srgb, #ec4899 32%, transparent) !important;
}
[data-theme="dark"] .prov-status-resync,
[data-theme="dark"] .tag-prov-resync {
  color: #f472b6 !important;
  background: rgba(236, 72, 153, 0.14) !important;
  border-color: rgba(236, 72, 153, 0.35) !important;
}
.prov-status-resync .prov-status-dot,
.tag-prov-resync .prov-status-dot {
  background: #ec4899;
  box-shadow: 0 0 6px rgba(236, 72, 153, 0.5);
}

/* Barra de Pestañas / Filtro del Escáner de Red */
.scanner-filter-bar {
  display: flex;
  gap: 0.4rem;
  background: var(--surface-1);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.scanner-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.18s ease;
}

.scanner-filter-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.scanner-filter-btn.active {
  background: var(--brand, #3b82f6);
  color: #ffffff;
  border-color: var(--brand, #3b82f6);
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
}

.scanner-filter-btn .badge-pill {
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 700;
}

.scanner-filter-btn.active .badge-pill {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Badge de Tipo de Dispositivo */
.badge-devtype-phone {
  background: color-mix(in srgb, var(--accent-cyan) 16%, transparent);
  color: var(--accent-cyan);
  border: 1px solid color-mix(in srgb, var(--accent-cyan) 30%, transparent);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-devtype-network {
  background: color-mix(in srgb, var(--surface-3) 50%, transparent);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font-size: 0.74rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Botón de Reinicio Remoto Inteligente */
.btn-reboot {
  background: color-mix(in srgb, #ef4444 12%, transparent) !important;
  color: #f87171 !important;
  border: 1px solid color-mix(in srgb, #ef4444 32%, transparent) !important;
  transition: all 0.2s ease !important;
}

.btn-reboot:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4) !important;
}

/* Badges de Categoría de Dispositivo en Aprovisionamiento */
.badge-device-physical {
  background: color-mix(in srgb, var(--brand, #3b82f6) 12%, transparent);
  color: var(--brand, #60a5fa);
  border: 1px solid color-mix(in srgb, var(--brand, #3b82f6) 28%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.badge-device-wireless {
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  color: #fbbf24;
  border: 1px solid color-mix(in srgb, #f59e0b 28%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.badge-device-softphone {
  background: color-mix(in srgb, #8b5cf6 12%, transparent);
  color: #a78bfa;
  border: 1px solid color-mix(in srgb, #8b5cf6 28%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

/* Indicador de Protección DECT Anti-Reinicio */
.tag-dect-protected {
  background: color-mix(in srgb, #64748b 15%, transparent);
  color: #94a3b8;
  border: 1px dashed color-mix(in srgb, #64748b 35%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: help;
  user-select: none;
  white-space: nowrap;
}

/* ── Teléfono flotante (mini WebPhone) ──────────────────────────────────
   Aloja el mismo iframe del WebPhone reparentado desde su pestaña, para
   poder llamar/atender sin salir del módulo activo. */
.mille-mini-phone {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 340px;
  height: 540px;
  max-height: calc(100vh - 40px);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mille-mini-phone[hidden] { display: none; }

.mille-mini-phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-color);
  cursor: move;
  user-select: none;
}
.mille-mini-phone-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.mille-mini-phone-actions { display: flex; gap: 6px; }
.mille-mini-phone-actions button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mille-mini-phone-actions button:hover { background: var(--primary, #2563eb); color: #fff; border-color: transparent; }

.mille-mini-phone-body { flex: 1; position: relative; }
.mille-mini-phone-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

.mille-mini-phone-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mille-mini-phone-pulse 1.8s ease-in-out infinite;
}
.mille-mini-phone-bubble[hidden] { display: none; }
@keyframes mille-mini-phone-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(37, 99, 235, 0.5); }
  50% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(37, 99, 235, 0); }
}

/* =========================================================================
   CONFIGURADOR DE MENU (DRAG & DROP)
   ========================================================================= */
.menu-config-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.menu-drag-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.menu-drag-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  cursor: grab;
}
.menu-drag-section-header:active {
  cursor: grabbing;
}
.menu-drag-section-header .drag-handle {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.menu-drag-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 40px; /* Para poder arrastrar a un contenedor vacio */
  padding: 0.5rem;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-color);
}

.menu-drag-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: grab;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: box-shadow 0.2s, transform 0.2s;
}
.menu-drag-item:active {
  cursor: grabbing;
}
.menu-drag-item:hover {
  border-color: var(--primary);
}
.menu-drag-item .drag-handle {
  color: var(--text-muted);
  cursor: grab;
}
.menu-drag-item-icon {
  font-size: 1.1rem;
}

.sortable-ghost {
  opacity: 0.4;
  background: var(--bg-body) !important;
}
.sortable-drag {
  opacity: 1 !important;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
  transform: scale(1.02);
}


.menu-editable-title {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: all 0.2s;
}

.menu-editable-title:hover {
  border-color: var(--border-color);
  background: var(--bg-body);
}

.menu-editable-title:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* =========================================================================
   SELECTOR VISUAL DE CENTRALES (HUB GLOBAL DE PANEL PRINCIPAL)
   ========================================================================= */
.home-fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}

.fleet-tenant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--dur-bounce) var(--ease-bounce),
              border-color var(--dur-bounce) var(--ease-bounce),
              box-shadow var(--dur-bounce) var(--ease-bounce);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.fleet-tenant-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent);
}

.fleet-tenant-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.fleet-tenant-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.3rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.fleet-tenant-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  letter-spacing: 0.5px;
}

.fleet-tenant-info {
  flex: 1;
  min-width: 0;
}

.fleet-tenant-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-tenant-legal {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-tenant-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.fleet-tenant-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.85rem 0;
  padding: 0.65rem 0.85rem;
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.fleet-meta-item-label {
  font-size: 0.68rem;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.fleet-meta-item-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-tenant-footer {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fleet-tenant-enter-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
}

/* =========================================================================
   CENTRO DE AYUDA GLOBAL Y MANUAL INTERACTIVO (MILL CLOUD SUITE)
   ========================================================================= */
.global-help-topic-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: all var(--dur-fast) var(--ease);
  width: 100%;
}

.global-help-topic-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  transform: translateX(3px);
}

.global-help-topic-btn.active {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.global-help-topic-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.global-help-topic-info {
  flex: 1;
  min-width: 0;
}

.global-help-topic-title {
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-help-topic-badge {
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 1px;
}

.global-help-section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.global-help-summary-box {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface-2));
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.global-help-guide-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: all var(--dur-fast) var(--ease);
}

.global-help-guide-card:hover {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  box-shadow: var(--shadow-sm);
}

.global-help-guide-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.global-help-guide-steps {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.86rem;
  color: var(--text-2);
  line-height: 1.6;
}

.global-help-guide-steps li {
  margin-bottom: 0.4rem;
}

/* Banner Flotante Guiado Global */
.mille-tour-banner {
  position: fixed;
  top: 75px;
  right: 28px;
  z-index: 10000;
  width: 410px;
  max-width: calc(100vw - 36px);
  background: var(--surface);
  border: 2px solid var(--brand);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.1), 0 0 25px var(--brand-glow);
  padding: 1.1rem 1.25rem;
  animation: milleTourSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  transition: width 0.2s ease, padding 0.2s ease;
}

@keyframes milleTourSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mille-tour-banner.is-dragging {
  user-select: none !important;
  opacity: 0.94;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 30px var(--brand-glow) !important;
}

.mille-tour-banner.is-minimized {
  width: auto !important;
  padding: 0.45rem 0.85rem !important;
  border-radius: var(--radius-full) !important;
  cursor: pointer;
}

.mille-tour-banner.is-minimized #mille-tour-body-area {
  display: none !important;
}

.mille-tour-banner.is-minimized .mille-tour-header {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  gap: 0.75rem !important;
}

.mille-tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.mille-tour-header:active {
  cursor: grabbing;
}

.mille-tour-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--brand) 15%, transparent);
  color: var(--brand);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mille-tour-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.mille-tour-min-btn,
.mille-tour-close {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast);
}

.mille-tour-min-btn:hover,
.mille-tour-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.mille-tour-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mille-tour-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-2);
}

.mille-tour-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Efecto Spotlight Luminoso en Elemento Enfocado */
.mille-guide-spotlight {
  position: relative;
  z-index: 999;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 60%, transparent), 0 0 25px var(--brand-glow) !important;
  animation: milleSpotlightPulse 1.8s infinite !important;
  transition: all 0.3s ease;
}

@keyframes milleSpotlightPulse {
  0% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 60%, transparent), 0 0 20px var(--brand-glow);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 30%, transparent), 0 0 35px var(--brand-glow);
  }
  100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 60%, transparent), 0 0 20px var(--brand-glow);
  }
}

/* --- Modal del Centro de Ayuda Global (Draggable, Maximizable, Responsive) --- */

/* Backdrop semitransparente (hermano del dialog, no padre) */
.global-help-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1050;
  cursor: default;
}
.global-help-backdrop.active { display: block; }

/* Ventana del manual: fixed, arrastrable, independiente del backdrop */
.modal-help-dialog {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1051;
  width: min(94vw, 1060px);
  height: min(85vh, 740px);
  min-height: 420px;
  max-height: calc(100vh - 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 0 1px var(--border);
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  transition: width 0.2s cubic-bezier(0.16,1,0.3,1),
              height 0.2s cubic-bezier(0.16,1,0.3,1),
              border-radius 0.2s ease;
}
.modal-help-dialog.active {
  display: flex;
  animation: modalScale var(--dur-modal, 0.22s) var(--ease-modal, cubic-bezier(0.16,1,0.3,1));
}

/* Modo Maximizado */
.modal-help-dialog.is-maximized {
  top: 10px !important;
  left: 10px !important;
  right: 10px !important;
  bottom: 10px !important;
  width: calc(100vw - 20px) !important;
  height: calc(100vh - 20px) !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  border-radius: var(--radius-lg) !important;
}

/* Estado de Arrastre */
.modal-help-dialog.is-dragging {
  user-select: none !important;
  transition: none !important;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 2px var(--brand) !important;
  opacity: 0.96;
  transform: none !important; /* ya usa left/top absolutos */
}

.modal-help-header {
  padding: 1.1rem 1.5rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.modal-help-header:active {
  cursor: grabbing;
}

.modal-help-header input,
.modal-help-header button,
.modal-help-header a {
  cursor: auto;
}

.modal-help-header .btn-close,
.modal-help-header #btn-help-maximize {
  cursor: pointer !important;
  transition: all 0.15s ease;
}

.modal-help-header #btn-help-maximize:hover {
  background: var(--surface-2);
  border-color: var(--brand);
  color: var(--brand);
}

.modal-help-body {
  flex: 1;
  display: grid;
  grid-template-columns: 290px 1fr;
  overflow: hidden;
  background: var(--surface);
  min-height: 0;
}

.global-help-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.global-help-content {
  overflow-y: auto;
  padding: 1.75rem 2rem;
  position: relative;
  min-height: 0;
}

/* Clases semánticas para el header */
.modal-help-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none; /* solo la cabecera vacia dispara drag */
}
.modal-help-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: all; /* los controles siguen siendo clicables */
}
.modal-help-icon {
  font-size: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.modal-help-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.modal-help-footer {
  padding: 0.65rem 1.5rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-3);
  gap: 1rem;
  flex-wrap: wrap;
}

/* Adaptación para pantallas de altura reducida */
@media (max-height: 680px) {
  .modal-help-dialog {
    height: 94vh !important;
    min-height: 360px !important;
    max-height: none !important;
  }
  .modal-help-header {
    padding: 0.65rem 1rem !important;
  }
  .modal-help-subtitle {
    display: none !important;
  }
  .modal-help-content {
    padding: 1rem 1.25rem !important;
  }
  .modal-help-footer {
    padding: 0.45rem 1rem !important;
  }
}

/* Adaptación para pantallas estrechas / móviles */
@media (max-width: 820px) {
  .modal-help-dialog {
    height: 94vh !important;
    width: 98vw !important;
  }
  .modal-help-body {
    grid-template-columns: 1fr !important;
  }
  #global-help-sidebar {
    max-height: 160px;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }
}





/* Central que se está viendo, debajo del título de cada módulo de una central
   (Reportería, Administrador PBX, Supervisor...). Lo pinta renderPageTenantChip(). */
.cp-page-tenant {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-2);
}
.cp-page-tenant[hidden] { display: none; }
.cp-page-tenant::before { content: '🏢'; font-size: 12px; }
.cp-page-tenant-label { color: var(--text-3, var(--text-2)); }
.cp-page-tenant-name { font-weight: 700; color: var(--text); }
.cp-page-tenant-code {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft, rgba(190, 48, 70, 0.1));
  border-radius: 6px;
  padding: 1px 6px;
}

/* =========================================================================
   MÓDULO: CLÚSTER & INFRAESTRUCTURA DE CENTRALES
   ========================================================================= */
.cluster-infra-wrap {
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.cluster-infra-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cluster-infra-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cluster-nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}
.cluster-node-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem;
  transition: all 0.2s ease;
}
.cluster-node-card:hover {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.cluster-node-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.cluster-node-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.cluster-node-ip {
  font-size: 0.8rem;
  color: var(--text-3);
  font-family: var(--font-mono, monospace);
}
.cluster-badge-online {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cluster-metric-row {
  margin-bottom: 0.75rem;
}
.cluster-metric-label-val {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.cluster-progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.cluster-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.fill-emerald { background: #10b981; }
.fill-amber { background: #f59e0b; }
.fill-red { background: #ef4444; }
.fill-blue { background: #3b82f6; }

.cluster-flavor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.cluster-flavor-card {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.65rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: all 0.2s ease;
}
.cluster-flavor-card:hover {
  border-color: var(--primary, #3b82f6);
  transform: translateY(-2px);
}
.cluster-flavor-card.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.cluster-flavor-name {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}
.cluster-flavor-desc {
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.3;
}

.cluster-provision-log {
  background: #0f172a;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  max-height: 220px;
  overflow-y: auto;
}
.provision-step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.provision-step-item.success { color: #4ade80; }
.provision-step-item.loading { color: #facc15; }
.provision-step-item.error { color: #f87171; }

.cluster-mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.cluster-mod-chip:hover {
  border-color: var(--primary, #3b82f6);
}
.cluster-mod-chip input[type="checkbox"] {
  cursor: pointer;
  accent-color: #10b981;
}

/* ==========================================================================
   ALERTA DE LLAMADA ENTRANTE WEBRTC (FLOATING TOP BANNER & NOTIFICATION)
   ========================================================================== */
.mille-incoming-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-150px);
  z-index: 100000;
  display: none;
  align-items: center;
  gap: 1.2rem;
  background: var(--surface-1, #1e293b);
  color: var(--text-1, #f8fafc);
  padding: 0.85rem 1.4rem;
  border-radius: 9999px;
  border: 2px solid #10b981;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(16, 185, 129, 0.35);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  opacity: 0;
  max-width: 92vw;
  box-sizing: border-box;
}

.mille-incoming-banner.mille-inc-visible {
  display: flex !important;
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.mille-inc-pulse-icon {
  position: relative;
  width: 44px;
  height: 44px;
  background: #10b981;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: mille-ring-pulse 1.4s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes mille-ring-pulse {
  to {
    box-shadow: 0 0 0 18px rgba(16, 185, 129, 0);
  }
}

.mille-inc-details {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.mille-inc-status-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #10b981;
  margin-bottom: 2px;
}

.mille-inc-caller-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  line-height: 1.2;
}

.mille-inc-caller-num {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
}

.mille-inc-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.5rem;
}

.mille-inc-btn {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.mille-inc-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.mille-inc-btn:active {
  transform: translateY(0);
}

.mille-inc-btn-ans {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.mille-inc-btn-dec {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.mille-inc-btn-open {
  background: var(--surface-2, rgba(255, 255, 255, 0.1));
  color: var(--text-1, #e2e8f0);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
}


/* Ficha del cliente: el titulo "Troncales" es el atajo a Administrador PBX ›
   Troncales (2026-10-06). Se ve igual que los demas titulos de la ficha; si
   el usuario puede entrar al PBX, toma el color de enlace y muestra la flecha. */
.home-trunks-title {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-align: left;
}
.home-trunks-title .home-trunks-arrow { display: none; }
.home-trunks-title:not(:disabled) { color: var(--brand); font-weight: 600; cursor: pointer; }
.home-trunks-title:not(:disabled) .home-trunks-arrow { display: inline; }
.home-trunks-title:not(:disabled):hover,
.home-trunks-title:not(:disabled):focus-visible { text-decoration: underline; outline: none; }
.home-trunks-title:disabled { cursor: default; opacity: 1; }
.home-trunk-tech {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid currentColor;
  opacity: 0.8;
}
#home-client-trunk-chips .tag-badge { max-width: 100%; flex-wrap: wrap; row-gap: 2px; }

/* --- Formularios como panel lateral (mismo estilo que el editor de extensiones del
   Administrador PBX, 2026-10-09). Los diálogos chicos (.modal-sm), el escáner de red
   (.modal-xl), el login y la paleta de comandos siguen siendo ventanas centradas. --- */
.modal-overlay:not(#login-overlay):not(#cp-cmd-palette):has(> .modal-card:not(.modal-sm):not(.modal-xl)) {
  padding: 0;
  justify-content: flex-end;
  align-items: stretch;
  overflow: hidden;
}
.modal-overlay:not(#login-overlay):not(#cp-cmd-palette) > .modal-card:not(.modal-sm):not(.modal-xl) {
  margin: 0;
  width: min(640px, 100vw) !important;
  max-width: 100vw !important;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  border-radius: 0;
  border: 0;
  border-left: 1px solid var(--border);
  padding-top: 0;
  animation: modalSlideIn var(--dur-modal) var(--ease-modal);
}
.modal-overlay:not(#login-overlay):not(#cp-cmd-palette) > .modal-card.modal-lg {
  width: min(820px, 100vw) !important;
}
.modal-overlay:not(#login-overlay):not(#cp-cmd-palette) > .modal-card:not(.modal-sm):not(.modal-xl) > .modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  margin: 0 calc(-1 * var(--sp-6)) var(--sp-5);
  padding: var(--sp-5) var(--sp-6) var(--sp-3);
  border-bottom: 1px solid var(--border-subtle, var(--border));
}
@keyframes modalSlideIn {
  from { transform: translateX(48px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* --- Ficha del modelo de teléfono en "Nuevo teléfono" (catálogo DDL 117, 2026-10-12) --- */
.phone-model-card { margin-top: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md, 10px);
  padding: 0.75rem 0.9rem; background: var(--surface); font-size: 0.82rem; }
.phone-model-card .pmc-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.phone-model-card .pmc-family { color: var(--text-muted); font-size: 0.75rem; }
.phone-model-card .pmc-badge { margin-left: auto; font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; }
.phone-model-card .pmc-ok { background: color-mix(in srgb, #10b981 15%, transparent); color: #059669; }
.phone-model-card .pmc-doc { background: color-mix(in srgb, #f59e0b 15%, transparent); color: #b45309; }
.phone-model-card .pmc-unknown { background: var(--surface-2, rgba(127,127,127,0.12)); color: var(--text-muted); }
.phone-model-card .pmc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.35rem 0.75rem; }
.phone-model-card .pmc-grid div { display: flex; justify-content: space-between; gap: 0.5rem; border-bottom: 1px dashed var(--border); padding: 0.15rem 0; }
.phone-model-card .pmc-grid span { color: var(--text-muted); }
.phone-model-card .pmc-note { margin-top: 0.45rem; color: var(--text-secondary); line-height: 1.4; }

/* --- Teléfonos (Aprovisionamiento) rediseñado 2026-10-12: resumen que filtra + lista compacta --- */
.prov2-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.prov2-sub { color: var(--text-secondary); font-size: 0.85rem; margin: 0.15rem 0 0; }
.prov2-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.prov2-more { position: relative; }
.prov2-more > summary { list-style: none; cursor: pointer; user-select: none; }
.prov2-more > summary::-webkit-details-marker { display: none; }
.prov2-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 230px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 0.3rem; display: flex; flex-direction: column; }
.prov2-menu.right { left: auto; right: 0; }
.prov2-actions .prov2-menu { left: auto; right: 0; }
.prov2-menu button { text-align: left; background: none; border: 0; padding: 0.5rem 0.65rem; border-radius: 7px; font: inherit; font-size: 0.84rem; color: var(--text-primary); cursor: pointer; }
.prov2-menu button:hover:not(:disabled) { background: var(--surface-2); }
.prov2-menu button:disabled { opacity: .55; cursor: default; }
.prov2-menu button.danger { color: var(--danger, #dc2626); }
.prov2-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.6rem; }
.prov2-chip { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  border-radius: 999px; padding: 0.3rem 0.75rem; font: inherit; font-size: 0.8rem; cursor: pointer; }
.prov2-chip b { color: var(--text-primary); }
.prov2-chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.prov2-chip.ok i { color: #10b981; } .prov2-chip.off i { color: #94a3b8; } .prov2-chip.warn i { color: #f59e0b; } .prov2-chip.muted i { color: #cbd5e1; }
.prov2-chip.active { border-color: var(--brand, #c0263a); color: var(--brand, #c0263a); background: color-mix(in srgb, var(--brand, #c0263a) 8%, transparent); }
.prov2-sep { width: 1px; height: 22px; background: var(--border); margin: 0 0.2rem; }
.prov2-toolbar { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; }
.prov2-toolbar input { flex: 1; min-width: 220px; height: 36px; }
.prov2-toolbar select { width: 180px; height: 38px; padding: 0 2rem 0 0.75rem; line-height: normal; font-size: 0.85rem; box-sizing: border-box; }
.prov2-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: visible; }
.prov2-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(220px, 1.6fr) minmax(220px, 1.6fr) minmax(140px, 1fr) auto;
  gap: 0.9rem; align-items: center; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); cursor: default; }
.prov2-row:last-child { border-bottom: 0; }
.prov2-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.prov2-ext b { display: block; font-size: 1rem; color: var(--text-highlight, var(--text-primary)); }
.prov2-ext span, .prov2-muted { color: var(--text-muted); font-size: 0.8rem; }
.prov2-model { display: flex; gap: 0.6rem; align-items: center; min-width: 0; }
.prov2-model b { display: block; font-size: 0.88rem; }
.prov2-model code { font-size: 0.75rem; color: var(--text-muted); background: none; padding: 0; }
.prov2-kind { font-size: 1.25rem; }
.prov2-status { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; }
.prov2-reg { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; }
.prov2-reg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.prov2-reg.ok { color: #059669; } .prov2-reg.ok i { background: #10b981; box-shadow: 0 0 0 3px color-mix(in srgb, #10b981 25%, transparent); }
.prov2-reg.off { color: var(--text-muted); } .prov2-reg.off i { background: #94a3b8; }
.prov2-state { color: var(--text-secondary); }
.prov2-state.warn { color: #b45309; font-weight: 600; }
.prov2-state.muted { color: var(--text-muted); }
.prov2-tag { font-size: 0.72rem; color: var(--text-secondary); }
.prov2-net { display: flex; flex-direction: column; gap: 0.15rem; }
.prov2-ip { font-weight: 600; font-size: 0.84rem; color: var(--accent-cyan); text-decoration: none; }
.prov2-act { display: flex; gap: 0.35rem; justify-content: flex-end; }
.prov2-btn { font-size: 0.78rem !important; padding: 0.3rem 0.6rem !important; }
.prov2-empty { padding: 2rem; text-align: center; color: var(--text-muted); }
.prov2-ipdetect { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.prov2-ipdetect input { flex: 1; }
.prov2-detect-msg { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.3rem; }
@media (max-width: 900px) {
  .prov2-row { grid-template-columns: 1fr auto; }
  .prov2-model, .prov2-status, .prov2-net { grid-column: 1 / -1; }
  .prov2-act { grid-column: 2; grid-row: 1; }
}
.prov2-btn.ok { color: #059669 !important; border-color: color-mix(in srgb, #10b981 45%, transparent) !important; }
.prov2-btn.warn { color: #b45309 !important; border-color: color-mix(in srgb, #f59e0b 45%, transparent) !important; }

/* --- Guía "copiá esto y pegalo acá" (2026-10-13) --- */
.ms-intro { background: color-mix(in srgb, var(--accent-cyan) 8%, transparent); border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.88rem; margin-bottom: 0.9rem; }
.ms-step { display: flex; gap: 0.75rem; align-items: flex-start; margin: 0.75rem 0; font-size: 0.88rem; }
.ms-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--brand, #c0263a); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.82rem; }
.ms-table { border: 1px solid var(--border); border-radius: 10px; margin-top: 0.5rem; }
.ms-row { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ms-row:last-child { border-bottom: 0; }
.ms-label { font-weight: 600; font-size: 0.84rem; }
.ms-label small { display: block; font-weight: 400; color: var(--text-muted); font-size: 0.75rem; }
.ms-value { display: flex; gap: 0.35rem; align-items: center; }
.ms-value code { font-size: 0.85rem; background: var(--surface-2); padding: 0.2rem 0.45rem; border-radius: 6px; word-break: break-all; }
.ms-planb { margin-top: 1rem; border: 1px dashed var(--border); border-radius: 10px; padding: 0.6rem 0.8rem; }
.ms-planb summary { cursor: pointer; font-weight: 600; font-size: 0.86rem; }
.ms-tip { margin-top: 1rem; font-size: 0.82rem; color: var(--text-secondary); }

.prov2-secret-override summary { cursor: pointer; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

.prov2-state.soft { color: var(--text-muted); font-style: italic; }
.prov2-row.soft .prov2-model b { font-weight: 600; }

.prov2-unknown { border: 1px solid var(--border); border-left: 3px solid #2563eb; border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0 0 0.75rem; background: var(--surface-2, transparent); }
.prov2-unknown-head { font-size: 0.85rem; margin-bottom: 0.4rem; }
.prov2-unknown-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; padding: 0.35rem 0; border-top: 1px solid var(--border); font-size: 0.82rem; }
.prov2-unknown-row code { font-size: 0.75rem; color: var(--text-muted); }
.prov2-unknown-act { margin-left: auto; display: flex; gap: 0.4rem; }
.prov2-tag.danger { color: #b91c1c; border-color: #fecaca; }

.prov2-finder-sub { font-size: 0.78rem; color: var(--text-muted); margin: -0.2rem 0 0.5rem; }
.prov2-finder-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.prov2-finder-bar .prov2-ipdetect { flex: 1; min-width: 220px; margin-top: 0; }
.prov2-finder-list { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem; max-height: 220px; overflow-y: auto; }
.prov2-finder-empty { font-size: 0.8rem; color: var(--text-muted); padding: 0.2rem 0; }
.prov2-finder-item { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; text-align: left; width: 100%;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1, transparent); padding: 0.45rem 0.6rem; cursor: pointer; font: inherit; color: inherit; font-size: 0.82rem; }
.prov2-finder-item:hover { border-color: var(--accent-cyan, #0891b2); }
.prov2-finder-item.picked { border-color: #16a34a; box-shadow: 0 0 0 2px color-mix(in srgb, #16a34a 25%, transparent); }
.prov2-finder-main code { font-size: 0.74rem; color: var(--text-muted); margin-left: 0.3rem; }
.prov2-finder-use { margin-left: auto; font-size: 0.76rem; color: var(--accent-cyan, #0891b2); font-weight: 600; }

.prov2-menu-wide { min-width: 300px; }
.prov2-menu-title { font-size: 0.68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); padding: 0.45rem 0.65rem 0.15rem; }
.prov2-menu-title:not(:first-child) { border-top: 1px solid var(--border); margin-top: 0.25rem; padding-top: 0.55rem; }
.prov2-menu-wide button { display: flex; flex-direction: column; gap: 1px; }
.prov2-menu-wide button small { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; padding-left: 1.45rem; }
@media (max-width: 600px) {
  .prov2-actions .prov2-menu { left: 0; right: auto; width: calc(100vw - 64px); min-width: 0; }
}

.prov2-toolbar-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 0.15rem; }
.prov2-tool { height: 38px; white-space: nowrap; font-size: 0.82rem; padding: 0 0.7rem; }
.prov2-finder-foot { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; margin-top: 0.55rem; font-size: 0.78rem; color: var(--text-muted); }
.prov2-finder-foot a { color: var(--accent-cyan, #0891b2); text-decoration: none; font-weight: 600; }
@media (max-width: 600px) {
  .prov2-toolbar-sep { display: none; }
  .prov2-tool { flex: 1; }
}
