/* ==========================================================================
   WiseLinks - Estilos Modernos con Variables CSS (Modo Oscuro / Modo Claro)
   ========================================================================== */

:root {
  /* Paleta Base - Modo Oscuro inspirado en wisemarketing.agency */
  --bg-main: #0a0b0e;
  --bg-surface: #12141a;
  --bg-surface-elevated: #181b24;
  --bg-surface-hover: #222634;
  --bg-input: #0e1015;
  
  --border-color: #242938;
  --border-color-subtle: #191c26;
  --border-color-focus: #ff6a00;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Colores Oficiales de Wise Marketing Agency (Sunset Amber / Warm Orange) */
  --primary: #ff6a00;
  --primary-hover: #ff8533;
  --primary-gradient: linear-gradient(135deg, #ff6a00 0%, #ff9500 100%);
  --primary-glow: rgba(255, 106, 0, 0.28);

  --wise-color: #ff6a00;
  --wise-bg: rgba(255, 106, 0, 0.12);
  --wise-border: rgba(255, 106, 0, 0.35);

  --onclusive-color: #0ea5e9;
  --onclusive-bg: rgba(14, 165, 233, 0.12);
  --onclusive-border: rgba(14, 165, 233, 0.35);

  --hvb-color: #00b4d8;
  --hvb-bg: rgba(0, 180, 216, 0.12);
  --hvb-border: rgba(0, 180, 216, 0.35);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --danger: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.15);
  --warning: #f59e0b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 24px rgba(255, 106, 0, 0.25);

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Claro */
[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-input: #ffffff;

  --border-color: #e2e8f0;
  --border-color-subtle: #cbd5e1;
  --border-color-focus: #ff6a00;

  --text-primary: #090a0d;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --primary: #ff6a00;
  --primary-hover: #e65c00;
  --primary-gradient: linear-gradient(135deg, #ff6a00 0%, #ff8533 100%);
  --primary-glow: rgba(255, 106, 0, 0.2);

  --wise-color: #ff6a00;
  --wise-bg: #fff2e8;
  --wise-border: #ffd1b3;

  --onclusive-color: #0284c7;
  --onclusive-bg: #e0f2fe;
  --onclusive-border: #7dd3fc;

  --hvb-color: #0077b6;
  --hvb-bg: #e0f7fa;
  --hvb-border: #90e0ef;

  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

/* Reseteo y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: -180px;
  left: 15%;
  width: 700px;
  height: 450px;
  background: radial-gradient(circle, rgba(255, 106, 0, 0.08) 0%, rgba(255, 106, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Encabezado */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.wise-logo-img {
  height: 28px;
  width: auto;
  max-width: 135px;
  object-fit: contain;
  display: block;
  transition: var(--transition);
}

[data-theme="light"] .wise-logo-img {
  filter: invert(1) brightness(0.15);
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
}

.brand-product-badge {
  background: var(--primary-gradient);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(255, 106, 0, 0.35);
  text-transform: uppercase;
}

.brand-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-left: 1px solid var(--border-color);
  padding-left: 0.75rem;
  display: none;
}

@media (min-width: 768px) {
  .brand-tag {
    display: inline-block;
  }
}

/* Selector Central de Workspace */
.workspace-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-main);
  padding: 0.3rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color-subtle);
}

.workspace-bar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 0.5rem;
  font-weight: 600;
  display: none;
}

@media (min-width: 768px) {
  .workspace-bar-label {
    display: inline-block;
  }
}

.workspace-switcher {
  display: flex;
  gap: 0.25rem;
}

.ws-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.ws-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.ws-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.ws-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ws-wise-dot { background-color: var(--wise-color); }
.ws-onclusive-dot { background-color: var(--onclusive-color); }
.ws-hvb-dot { background-color: var(--hvb-color); }

/* Botones de Cabecera */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-button {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-button:hover {
  color: var(--text-primary);
  border-color: var(--border-color-focus);
}

/* Contenido Principal */
.main-content {
  flex: 1;
  padding: 2rem 1.5rem;
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Grid de Métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-focus);
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.metric-icon-purple {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.metric-icon-green {
  background: var(--success-bg);
  color: var(--success);
}

.metric-icon-wise {
  background: var(--wise-bg);
  color: var(--wise-color);
}

.metric-icon-onclusive {
  background: var(--onclusive-bg);
  color: var(--onclusive-color);
}

.metric-icon-hvb {
  background: var(--hvb-bg);
  color: var(--hvb-color);
}

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Tarjeta del Creador de Enlaces */
.creator-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.creator-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--wise-color), var(--onclusive-color));
}

.creator-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.creator-title-area h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.creator-title-area p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.current-workspace-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.825rem;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wise-color);
}

/* Formulario */
.shorten-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.label-hint {
  font-weight: normal;
  color: var(--text-muted);
}

.field-help {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-icon {
  padding-left: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.main-url-row input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.btn-paste {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  margin-right: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-paste:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.form-grid-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.slug-prefix {
  padding-left: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
  white-space: nowrap;
}

#custom-slug {
  width: 100%;
  padding: 0.75rem 0.85rem 0.75rem 0.25rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
}

.input-date {
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.input-date:focus {
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Control Segmentado (Wise vs Onclusive) */
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-input);
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

.segment-option {
  cursor: pointer;
}

.segment-option input {
  display: none;
}

.segment-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: center;
}

.segment-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.segment-option input:checked + .segment-wise {
  background: var(--wise-bg);
  color: var(--wise-color);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--wise-border);
}

.segment-option input:checked + .segment-onclusive {
  background: var(--onclusive-bg);
  color: var(--onclusive-color);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--onclusive-border);
}

.segment-option input:checked + .segment-hvb {
  background: var(--hvb-bg);
  color: var(--hvb-color);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--hvb-border);
}

/* Botón de Enviar Principal */
.btn-primary {
  background: var(--primary-gradient);
  color: white;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.9rem 1.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(255, 106, 0, 0.45);
}

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

/* Spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tarjeta de Resultado */
.result-card {
  margin-top: 1.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.result-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .result-body {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.result-info {
  flex: 1;
}

.result-url-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-main);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.result-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--wise-bg);
  color: var(--wise-color);
  text-transform: uppercase;
}

.result-tag.onclusive {
  background: var(--onclusive-bg);
  color: var(--onclusive-color);
}

.result-tag.hvb {
  background: var(--hvb-bg);
  color: var(--hvb-color);
}

#result-short-url {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}

.btn-action-copy {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-action-copy:hover {
  background: var(--primary-hover);
}

.btn-action-visit {
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  text-decoration: none;
}

.btn-action-visit:hover {
  color: var(--text-primary);
}

.result-dest-info {
  margin-top: 0.6rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.35rem;
}

.result-dest-text {
  color: var(--text-secondary);
  word-break: break-all;
}

/* Caja de QR de Resultado */
.result-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: white;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-preview canvas, .qr-preview img {
  display: block;
  max-width: 140px;
  height: auto;
}

.btn-download-qr {
  background: #0f172a;
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
  width: 100%;
  justify-content: center;
}

.btn-download-qr:hover {
  background: #334155;
}

/* Sección de Analítica (Chart.js) */
.analytics-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.section-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-text-toggle {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
}

/* Tabla de Enlaces */
.links-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .table-card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.table-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.links-counter-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.search-input-wrapper svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
}

.search-input-wrapper input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem 0.45rem 2.2rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  width: 230px;
  transition: var(--transition);
}

.search-input-wrapper input:focus {
  border-color: var(--border-color-focus);
}

.btn-refresh {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-refresh:hover {
  color: var(--text-primary);
  border-color: var(--border-color-focus);
}

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

.links-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.links-table th {
  background: var(--bg-surface-elevated);
  padding: 0.85rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.links-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color-subtle);
  font-size: 0.875rem;
  vertical-align: middle;
}

.links-table tbody tr:hover {
  background: var(--bg-surface-elevated);
}

.th-actions {
  text-align: right;
}

/* Celdas de la tabla */
.short-link-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.short-link-anchor {
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

.short-link-anchor:hover {
  text-decoration: underline;
}

.btn-table-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.btn-table-copy:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.dest-url-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

/* Badges de Workspace */
.ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.ws-badge.wise {
  background: var(--wise-bg);
  color: var(--wise-color);
  border: 1px solid var(--wise-border);
}

.ws-badge.onclusive {
  background: var(--onclusive-bg);
  color: var(--onclusive-color);
  border: 1px solid var(--onclusive-border);
}

.ws-badge.hvb {
  background: var(--hvb-bg);
  color: var(--hvb-color);
  border: 1px solid var(--hvb-border);
}

/* Badges de Clics */
.clicks-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.clicks-pill.has-clicks {
  border-color: var(--success);
  color: var(--success);
}

/* Botones de Acción de Tabla */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.action-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-color-focus);
}

.action-btn.delete-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

/* Estados Vacíos y de Carga */
.loading-state, .empty-state {
  text-align: center;
  padding: 3rem !important;
  color: var(--text-muted);
}

/* Modales */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  position: relative;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-stats {
  max-width: 680px;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color-subtle);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.mono-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  word-break: break-all;
}

.modal-qr-body {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
}

.qr-box {
  background: white;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.modal-actions {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color-subtle);
}

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

.stats-summary-strip {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-pill {
  background: var(--bg-surface-elevated);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.clicks-log-container {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.clicks-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.clicks-log-table th {
  background: var(--bg-surface-elevated);
  padding: 0.6rem 0.75rem;
  color: var(--text-muted);
  position: sticky;
  top: 0;
}

.clicks-log-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color-subtle);
  color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 200;
}

.toast {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

/* Pie de página */
.app-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.wise-logo-img-footer {
  height: 22px;
  width: auto;
  opacity: 0.85;
  margin-bottom: 0.35rem;
  transition: var(--transition);
}

[data-theme="light"] .wise-logo-img-footer {
  filter: invert(1) brightness(0.15);
}

.footer-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Utilidades */
.hidden {
  display: none !important;
}
