/* ===================================================
   Competitive Web Intelligence · Arbitrade
   Styles V3 compatible + SaaS dashboard layer
   =================================================== */

/* --- TOKENS V3 --- */
:root {
  --bg:             #F4F0EA;
  --surface:        #FFFFFF;
  --surface-2:      #EFE2DC;
  --text-primary:   #1A1210;
  --text-secondary: rgba(41,28,28,0.58);
  --text-muted:     rgba(41,28,28,0.36);
  --border:         rgba(41,28,28,0.10);
  --border-hover:   rgba(255,95,21,0.30);
  --primary:        #FF5F15;
  --primary-hover:  #C72D07;
  --accent-dim:     rgba(255,95,21,0.08);
  --honey:          #DDCA19;
  --green:          #60A022;
  --blue:           #0676FF;

  /* Dashboard semantic tokens */
  --c-green:        #16A34A;
  --c-green-bg:     #F0FDF4;
  --c-amber:        #D97706;
  --c-amber-bg:     #FFFBEB;
  --c-red:          #DC2626;
  --c-red-bg:       #FEF2F2;
  --c-blue:         #2563EB;
  --c-blue-bg:      #EFF6FF;
  --c-purple:       #7C3AED;
  --c-purple-bg:    #F5F3FF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(41,28,28,0.07), 0 1px 2px rgba(41,28,28,0.04);
  --shadow-md: 0 4px 12px rgba(41,28,28,0.08), 0 2px 4px rgba(41,28,28,0.04);
  --shadow-lg: 0 12px 32px rgba(41,28,28,0.12), 0 4px 8px rgba(41,28,28,0.06);
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* --- AUTH LOADING --- */
.auth-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 16px;
  color: var(--text-secondary); font-size: 14px;
}
.auth-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- TOP BAR --- */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 36px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(41,28,28,0.08);
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.top-bar.is-scrolled {
  background: rgba(255,255,255,0.88);
  border-bottom-color: rgba(41,28,28,0.12);
  box-shadow: 0 4px 20px rgba(56,25,26,0.06);
}
.top-bar-left, .top-bar-right { display: flex; align-items: center; gap: 12px; }
.back-link {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: color .2s;
}
.back-link:hover { color: var(--primary); }
.page-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.page-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 20px;
  background: var(--accent-dim); color: var(--primary);
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border-radius: 20px;
  padding: 5px 10px 5px 5px;
}
.user-chip-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
#user-email { font-size: 12px; color: var(--text-secondary); }
.btn-action {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: var(--surface-2); color: var(--text-secondary);
  transition: background .2s, color .2s;
}
.btn-action:hover { background: var(--border); color: var(--text-primary); }

/* --- PAGE HERO --- */
.page-hero {
  position: relative; max-width: 1440px; margin: 0 auto;
  padding: 36px 36px 8px;
}
.page-hero-glow {
  position: absolute; top: 10px; right: -100px;
  width: 380px; height: 240px;
  background: radial-gradient(60% 60% at 50% 50%,
    rgba(255,95,21,0.13) 0%, rgba(255,167,112,0.08) 35%, transparent 70%);
  filter: blur(36px); pointer-events: none; z-index: 0;
}
.page-hero-content { position: relative; z-index: 1; }
.page-hero-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px;
}
.page-hero h1 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 400;
  font-variation-settings: "opsz" 72, "SOFT" 30, "WONK" 0;
  font-size: clamp(26px, 2.8vw, 36px); line-height: 1.1;
  letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 8px;
}
.page-hero h1 .ph-accent { color: var(--primary); font-weight: 500; }
.page-hero p { font-size: 14px; color: var(--text-secondary); line-height: 1.55; max-width: 580px; }

/* --- DASHBOARD WRAPPER --- */
.dashboard-wrapper {
  max-width: 1440px; margin: 0 auto;
  padding: 0 36px 60px;
}

/* --- COMPANIES BAR (secondary, below tabs) --- */
.companies-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0 0; flex-wrap: wrap;
}
.companies-bar-left {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap;
}
.companies-bar-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.companies-bar-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; flex-shrink: 0;
}

.competitor-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 8px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  transition: all .2s; white-space: nowrap;
}
.chip:hover { border-color: var(--border-hover); color: var(--text-primary); }
.chip.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.chip.active .chip-dot { background: rgba(255,255,255,0.4); }
.chip-all { background: var(--surface-2); }
.chip-all.active { background: var(--text-primary); }
.chip-self { border-color: rgba(255,95,21,0.35); }
.chip-self.active { background: var(--primary); border-color: var(--primary); }
.chip-self-label {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 1px 5px; border-radius: 8px;
  background: rgba(255,95,21,0.15); color: var(--primary); margin-left: 2px;
}
.chip-self.active .chip-self-label {
  background: rgba(255,255,255,0.25); color: #fff;
}
.self-tag {
  display: inline-block; font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 1px 5px; border-radius: 6px;
  background: rgba(255,95,21,0.12); color: var(--primary);
  vertical-align: middle; margin-left: 4px;
}
.chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.chip-status {
  font-size: 10px; opacity: 0.7;
  border-left: 1px solid rgba(255,255,255,0.3); padding-left: 6px;
}

.last-update { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.btn-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-secondary); transition: all .2s;
}
.btn-toolbar:hover { border-color: var(--border-hover); color: var(--primary); background: var(--accent-dim); }
.btn-export { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-export:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

/* chips más pequeños en la barra secundaria */
.companies-bar .chip {
  font-size: 11.5px; padding: 4px 10px 4px 7px;
  border-color: rgba(41,28,28,0.07);
  background: transparent; color: var(--text-muted);
}
.companies-bar .chip:hover { color: var(--text-primary); border-color: var(--border); background: var(--surface); }
.companies-bar .chip.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.companies-bar .chip-self { border-color: rgba(255,95,21,0.25); }
.companies-bar .chip-all { background: transparent; }
.companies-bar .chip-dot { width: 7px; height: 7px; }
.companies-bar .chip-self-label { font-size: 9px; }

/* --- TABS --- */
.tabs-nav-wrapper {
  margin-top: 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs-nav {
  display: flex; gap: 0; min-width: max-content;
}
.tab-btn {
  padding: 11px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  transition: all .2s; white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* --- TAB CONTENT --- */
.tab-content { padding-top: 28px; }

/* --- SECTION TITLE --- */
.section-title {
  font-family: 'Fraunces', Georgia, serif; font-weight: 400;
  font-variation-settings: "opsz" 36, "SOFT" 30, "WONK" 0;
  font-size: 20px; color: var(--text-primary); margin-bottom: 4px;
}
.section-sub {
  font-size: 13px; color: var(--text-muted); margin-bottom: 24px;
}

/* ===================================================
   TAB: RESUMEN EJECUTIVO
   =================================================== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 0;
}
.summary-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
  position: relative; overflow: hidden;
}
.summary-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.summary-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, var(--card-accent, rgba(255,95,21,0.12)) 0%, transparent 70%);
  filter: blur(20px); transition: opacity .3s;
  transform: translate(20px, -20px);
}
.summary-card:hover::before { opacity: 1; }
.sc-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px;
}
.sc-winner {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.sc-winner-badge {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sc-winner-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sc-winner-url { font-size: 11px; color: var(--text-muted); }
.sc-text { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.sc-action {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--primary);
  display: flex; align-items: center; gap: 4px;
}
.sc-icon { font-size: 20px; margin-bottom: 8px; }

/* score pill */
.score-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.score-pill.high { background: var(--c-green-bg); color: var(--c-green); }
.score-pill.med  { background: var(--c-amber-bg); color: var(--c-amber); }
.score-pill.low  { background: var(--c-red-bg);   color: var(--c-red); }

/* ===================================================
   TAB: RANKING
   =================================================== */
.ranking-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 900px) { .ranking-grid { grid-template-columns: 1fr; } }

.ranking-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.ranking-card-title {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 18px; display: flex; align-items: center; gap: 8px;
}
.ranking-card-title .rc-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

.ranking-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.ranking-row:last-child { border-bottom: none; }
.rank-pos {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface-2); font-size: 11px; font-weight: 700;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rank-pos.p1 { background: #FEF9C3; color: #854D0E; }
.rank-pos.p2 { background: #F1F5F9; color: #475569; }
.rank-pos.p3 { background: #FEF3C7; color: #92400E; }
.rank-name {
  width: 110px; flex-shrink: 0;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.rank-bar-wrap { flex: 1; }
.rank-bar-track {
  height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden;
}
.rank-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.rank-score {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  width: 28px; text-align: right; flex-shrink: 0;
}
.rank-label {
  width: 52px; flex-shrink: 0; text-align: right;
}

/* global score table */
.global-ranking { margin-bottom: 20px; }
.global-ranking-header {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gr-table { width: 100%; border-collapse: collapse; }
.gr-table thead th {
  padding: 10px 16px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); text-align: left;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.gr-table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.gr-table tbody tr:last-child { border-bottom: none; }
.gr-table tbody tr:hover { background: var(--accent-dim); }
.gr-table tbody td { padding: 12px 16px; font-size: 13px; }
.gr-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.gr-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.gr-score-cell { font-weight: 700; font-size: 15px; }
.gr-bar-mini { display: flex; align-items: center; gap: 8px; }
.gr-bar-track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.gr-bar-fill { height: 100%; border-radius: 3px; }
.dimension-note {
  font-size: 11px; color: var(--text-muted); margin-top: 12px;
  padding: 10px 14px; background: var(--surface-2); border-radius: 8px;
}

/* ===================================================
   TAB: SERVICIOS MATRIX
   =================================================== */
.services-matrix-wrap {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.services-matrix {
  width: 100%; border-collapse: collapse; min-width: 680px;
}
.services-matrix thead th {
  padding: 12px 16px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  color: var(--text-secondary); text-align: center; white-space: nowrap;
}
.services-matrix thead th:first-child { text-align: left; min-width: 180px; }
.services-matrix tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.services-matrix tbody tr:last-child { border-bottom: none; }
.services-matrix tbody tr:hover { background: rgba(255,95,21,0.03); }
.services-matrix td { padding: 10px 16px; font-size: 13px; text-align: center; }
.services-matrix td:first-child { text-align: left; font-weight: 500; color: var(--text-primary); }
.service-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; font-size: 14px;
}
.cell-destacado { background: #FEF9C3; color: #854D0E; }
.cell-si        { background: var(--c-green-bg); color: var(--c-green); }
.cell-parcial   { background: var(--c-amber-bg); color: var(--c-amber); }
.cell-no        { background: var(--surface-2); color: var(--text-muted); }

.matrix-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
}

/* competitor header chips */
.th-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; color: #fff;
}

/* ===================================================
   TAB: SEGMENTOS & PROPUESTA
   =================================================== */
.segments-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.seg-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.seg-card-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.seg-badge {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.seg-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.seg-url  { font-size: 11px; color: var(--text-muted); }
.seg-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-tag {
  padding: 3px 9px; border-radius: 12px;
  font-size: 11.5px; font-weight: 500;
  background: var(--surface-2); color: var(--text-secondary);
}

/* value proposition board */
.vp-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.vp-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px 22px;
  box-shadow: var(--shadow-sm); position: relative;
}
.vp-quote {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 36, "SOFT" 60, "WONK" 0;
  font-size: 14px; color: var(--text-primary); line-height: 1.5;
  margin-bottom: 14px; font-style: italic;
}
.vp-meta-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.vp-meta-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.vp-meta-val { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.vp-differentiator {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
  padding: 10px 12px; border-radius: 8px; background: var(--surface-2);
  margin-bottom: 12px;
}
.vp-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.vp-tag {
  padding: 3px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--accent-dim); color: var(--primary);
}
.vp-kw { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* ===================================================
   TAB: CONVERSIÓN
   =================================================== */
.conversion-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.conv-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.conv-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.conv-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.conv-score-ring {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; flex-shrink: 0;
}
.conv-checklist { display: flex; flex-direction: column; gap: 6px; }
.conv-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-secondary);
}
.conv-item.yes { color: var(--c-green); }
.conv-item.no  { color: var(--text-muted); opacity: 0.6; text-decoration: line-through; }
.conv-check {
  width: 18px; height: 18px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; flex-shrink: 0;
}
.conv-check.yes { background: var(--c-green-bg); color: var(--c-green); }
.conv-check.no  { background: var(--surface-2); color: var(--text-muted); }
.conv-bar-wrap { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.conv-bar-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.conv-bar-track { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.conv-bar-fill  { height: 100%; border-radius: 3px; transition: width .6s; }

/* ===================================================
   TAB: POSICIONAMIENTO
   =================================================== */
.positioning-wrap { display: flex; gap: 24px; align-items: flex-start; }
@media (max-width: 900px) { .positioning-wrap { flex-direction: column; } }

.positioning-map-container {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 28px; box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.positioning-map {
  position: relative; width: 420px; height: 420px;
  border: 1px solid var(--border); border-radius: 12px;
  background:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 20% 20%;
  overflow: visible;
}
@media (max-width: 600px) {
  .positioning-map { width: 300px; height: 300px; }
}

/* quadrant labels */
.quad-label {
  position: absolute; font-size: 10px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
  pointer-events: none; max-width: 80px; text-align: center; line-height: 1.3;
}
.quad-tl { top: 10px;  left: 10px; }
.quad-tr { top: 10px;  right: 10px; text-align: right; }
.quad-bl { bottom: 10px; left: 10px; }
.quad-br { bottom: 10px; right: 10px; text-align: right; }

/* axis arrows */
.axis-x, .axis-y {
  position: absolute; background: var(--border);
}
.axis-x { height: 1px; width: 100%; top: 50%; left: 0; }
.axis-y { width: 1px; height: 100%; left: 50%; top: 0; }
.axis-label {
  position: absolute; font-size: 10px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.1em; white-space: nowrap; pointer-events: none;
}
.axis-label.x-left  { bottom: -22px; left: 0; }
.axis-label.x-right { bottom: -22px; right: 0; }
.axis-label.y-top   { top: -22px; left: 50%; transform: translateX(-50%); }
.axis-label.y-bottom{ bottom: -22px; left: 50%; transform: translateX(-50%); display: none; }

.pos-dot {
  position: absolute; transform: translate(-50%, -50%);
  z-index: 10; cursor: pointer; transition: transform .2s;
}
.pos-dot:hover { transform: translate(-50%, -50%) scale(1.15); z-index: 20; }
.pos-dot-inner {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border: 2px solid rgba(255,255,255,0.6);
}
.pos-label {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; white-space: nowrap;
  background: var(--surface); padding: 2px 6px; border-radius: 4px;
  box-shadow: var(--shadow-sm); color: var(--text-primary);
}

.positioning-legend {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
}
.pos-legend-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 14px 16px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.pos-legend-card:hover { border-color: var(--border-hover); transform: translateX(4px); }
.pos-legend-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.pos-legend-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.pos-legend-name { font-size: 13px; font-weight: 700; }
.pos-legend-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ===================================================
   TAB: RADAR DE CAMBIOS
   =================================================== */
.changes-timeline { display: flex; flex-direction: column; gap: 0; }
.change-item {
  display: flex; gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.change-item:last-child { border-bottom: none; }
.change-date-col { width: 80px; flex-shrink: 0; text-align: right; padding-top: 2px; }
.change-date { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.change-dot-col {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; width: 20px;
}
.change-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--border);
}
.change-line {
  width: 2px; flex: 1; background: var(--border);
  margin-top: 6px;
}
.change-body { flex: 1; }
.change-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap;
}
.change-company {
  font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 12px;
  color: #fff;
}
.change-type-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px;
  background: var(--surface-2); color: var(--text-secondary);
}
.impact-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.impact-alto   { background: #FEF2F2; color: var(--c-red); }
.impact-medio  { background: var(--c-amber-bg); color: var(--c-amber); }
.impact-bajo   { background: var(--c-green-bg); color: var(--c-green); }
.change-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ===================================================
   TAB: OPORTUNIDADES
   =================================================== */
.opp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.opp-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
  border-left: 3px solid transparent;
}
.opp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.opp-card.impact-alto  { border-left-color: var(--c-red); }
.opp-card.impact-medio { border-left-color: var(--c-amber); }
.opp-card.impact-bajo  { border-left-color: var(--c-green); }
.opp-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.opp-title { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.opp-area-badge {
  font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 20px;
  background: var(--c-blue-bg); color: var(--c-blue);
  white-space: nowrap; flex-shrink: 0;
}
.opp-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; }
.opp-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.opp-meta-item { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.opp-comp { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; color: #fff; }

/* ===================================================
   MODAL - COMPETITOR DETAIL
   =================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26,18,16,0.5);
  backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 820px;
  padding: 32px; position: relative;
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); font-size: 18px; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }

.modal-hero {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px;
}
.modal-badge {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.modal-name { font-size: 22px; font-weight: 800; color: var(--text-primary); margin-bottom: 2px; }
.modal-url  { font-size: 12px; color: var(--text-muted); }
.modal-summary { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-top: 6px; }

.modal-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 600px) { .modal-two-col { grid-template-columns: 1fr; } }
.modal-block {
  background: var(--surface-2); border-radius: 12px; padding: 16px 18px;
}
.modal-block-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-muted); margin-bottom: 10px;
}
.modal-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.modal-list li {
  font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: flex-start; gap: 6px;
}
.modal-list li::before { content: '•'; color: var(--primary); flex-shrink: 0; }

.strength-list li::before { color: var(--c-green); }
.weakness-list li::before { color: var(--c-red); }

/* ===================================================
   TOAST
   =================================================== */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  padding: 12px 20px; border-radius: 10px;
  background: var(--text-primary); color: #fff;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); opacity: 0;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 768px) {
  .top-bar { padding: 12px 16px; }
  .page-hero { padding: 24px 16px 8px; }
  .dashboard-wrapper { padding: 0 16px 48px; }
  .dashboard-toolbar { padding-top: 16px; }
  #user-email { display: none; }
  .summary-cards { grid-template-columns: 1fr; }
  .vp-cards { grid-template-columns: 1fr; }
  .conversion-grid { grid-template-columns: 1fr; }
  .opp-grid { grid-template-columns: 1fr; }
  .positioning-map { width: 300px; height: 300px; }
  .ranking-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .toolbar-right .last-update { display: none; }
  .btn-toolbar span { display: none; }
}

/* ===================================================
   UTILITY
   =================================================== */
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.text-muted { color: var(--text-muted); font-size: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 14px;
}
