/* RadarFlex UI Kit v0.2 · Patrones propios, prefijo rf- para minimizar colisiones. */
.rf-shell { min-height: 100dvh; display: grid; grid-template-columns: var(--rf-ui-sidebar-width) minmax(0, 1fr); }
.rf-sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; color: #fff; background: linear-gradient(160deg, #003941, #004E5D 70%, #005765); z-index: 1040; }
.rf-sidebar__brand { min-height: 96px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 14px 18px; border-bottom: 1px solid var(--rf-ui-border-soft); }
.rf-sidebar__brand img { display: block; width: 230px; height: auto; max-width: 100%; }
.rf-sidebar__nav { overflow: auto; padding: 12px; flex: 1 1 auto; scrollbar-width: thin; scrollbar-color: rgba(224,244,245,.45) transparent; }
.rf-sidebar__group { color: #C6E2E5; font-weight: 700; font-size: .75rem; letter-spacing: .045em; margin: 20px 12px 8px; text-transform: uppercase; }
.rf-sidebar__link { display: flex; align-items: center; min-height: 46px; gap: .8rem; width: 100%; padding: .65rem .85rem; margin-block: 3px; color: #F0F9FA; border-radius: .625rem; font-size: .875rem; font-weight: 500; text-decoration: none; border: 0; background: transparent; }
.rf-sidebar__link:hover { color: #fff; background: rgba(255,255,255,.12); }
.rf-sidebar__link[aria-current="page"], .rf-sidebar__link.is-active { color: #fff; background: rgba(145,223,225,.24); box-shadow: inset 3px 0 0 var(--rf-brand-gold); font-weight: 700; }
.rf-sidebar__link i, .rf-sidebar__link svg { flex: none; width: 20px; text-align: center; }
.rf-sidebar__footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.18); }
.rf-sidebar__context { border: 1px solid rgba(255,255,255,.23); background: rgba(255,255,255,.075); padding: 15px; border-radius: 12px; font-size: .875rem; }
.rf-sidebar__context strong { display: block; font-weight: 700; }
.rf-sidebar__context small { display: block; margin-top: 4px; color: #D6EDEF; font-size: .8125rem; }
.rf-main { min-width: 0; }
.rf-topbar { min-height: var(--rf-ui-header-height); position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid var(--rf-ui-border-soft); display: flex; align-items: center; padding: .75rem clamp(16px,2.2vw,30px); gap: 1rem; }
.rf-topbar__title { font-weight: 700; font-size: .875rem; color: var(--rf-ui-ink-soft); }
.rf-topbar__tools { display: flex; align-items: center; gap: 10px; min-width: 0; margin-left: auto; }
.rf-context-select { min-width: 168px; max-width: 300px; min-height: 44px; border: 1px solid var(--rf-ui-border); border-radius: .625rem; background: #fff; padding: .45rem .75rem; display: flex; flex-direction: column; justify-content: center; }
.rf-context-select__label { font-size: .6875rem; font-weight: 700; color: var(--rf-ui-ink-soft); line-height: 1.25; }
.rf-context-select__value { font-weight: 700; font-size: .875rem; line-height: 1.5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rf-workspace { width: 100%; max-width: var(--rf-ui-content-width); margin: 0 auto; padding: clamp(16px,2.1vw,30px); }
.rf-page-title { font-size: clamp(1.55rem,2.1vw,2rem); margin: 0 0 .4rem; }
.rf-page-subtitle { color: var(--rf-ui-ink-soft); font-size: .9375rem; margin: 0; }
.rf-section { background: var(--rf-ui-card); border: 1px solid var(--rf-ui-border); border-radius: .875rem; box-shadow: var(--rf-ui-shadow); }
.rf-section__header { padding: 18px 20px; border-bottom: 1px solid var(--rf-ui-border-soft); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.rf-section__title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.rf-section__body { padding: 20px; }
.rf-kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.rf-kpi { --rf-kpi-accent: var(--rf-ui-primary); --rf-kpi-soft: var(--rf-ui-primary-soft); background: #fff; border: 1px solid var(--rf-ui-border); border-radius: .875rem; box-shadow: var(--rf-ui-shadow); padding: 19px; border-top: 3px solid var(--rf-kpi-accent); min-width: 0; }
.rf-kpi--blue { --rf-kpi-accent: var(--rf-ui-blue); --rf-kpi-soft: var(--rf-ui-blue-soft); }
.rf-kpi--green { --rf-kpi-accent: var(--rf-ui-green); --rf-kpi-soft: var(--rf-ui-green-soft); }
.rf-kpi--purple { --rf-kpi-accent: var(--rf-ui-purple); --rf-kpi-soft: var(--rf-ui-purple-soft); }
.rf-kpi--amber { --rf-kpi-accent: var(--rf-ui-amber); --rf-kpi-soft: var(--rf-ui-amber-soft); }
.rf-kpi__icon { display: inline-grid; place-items: center; width: 44px; height: 44px; background: var(--rf-kpi-soft); color: var(--rf-kpi-accent); border-radius: .75rem; font-size: 1.35rem; }
.rf-kpi__label { color: var(--rf-ui-ink-soft); font-weight: 600; font-size: .875rem; }
.rf-kpi__value { color: var(--rf-ui-ink); font-size: clamp(1.55rem,2.2vw,1.95rem); font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; margin-block: .5rem .4rem; }
.rf-kpi__context { color: var(--rf-ui-ink-muted); font-size: .8125rem; }
.rf-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--rf-ui-border); border-radius: .75rem; padding: 12px; }
.rf-filterbar__search { flex: 1 1 245px; min-width: 180px; }
.rf-filterbar__actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-left: auto; }
.rf-table-wrap { overflow-x: auto; max-width: 100%; scrollbar-width: thin; scrollbar-color: #9FB9C2 #EFF3F5; }
.rf-table-wrap .table { white-space: nowrap; margin-bottom: 0; font-size: .875rem; }
.rf-table-wrap .table td.rf-col-wrap { white-space: normal; min-width: 230px; }
.rf-table-wrap .table td.rf-col-actions { text-align: end; white-space: nowrap; }
.rf-badge { display: inline-flex; gap: .3rem; align-items: center; padding: .32rem .68rem; border-radius: .5rem; font-size: .75rem; font-weight: 700; line-height: 1.35; vertical-align: middle; }
.rf-badge--ok { color: var(--rf-ui-green); background: var(--rf-ui-green-soft); }
.rf-badge--info { color: #245E9B; background: var(--rf-ui-blue-soft); }
.rf-badge--warning { color: var(--rf-ui-amber); background: var(--rf-ui-amber-soft); }
.rf-badge--danger { color: var(--rf-ui-red); background: var(--rf-ui-red-soft); }
.rf-badge--pending { color: #4C5D6D; background: #EDF1F4; }
/* La modalidad siempre se escribe completa: la identidad visual no sustituye la etiqueta. */
.rf-surface { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem; border: 1px solid currentColor; border-radius: .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .005em; }
.rf-surface--api { color: #005D6B; background: #E5F3F4; }
.rf-surface--consumer { color: #245E9B; background: #E5F1FD; }
.rf-surface--serp-ai { color: #7447A5; background: #F1E8FA; }
.rf-surface--serp-organic { color: #805200; background: #FFF2DA; }
.rf-surface--search-only { color: #4C5D6D; background: #EDF1F4; }
.rf-content-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(285px,350px); gap: 16px; align-items: start; }
.rf-evidence-panel { border: 1px solid var(--rf-ui-border); background: #fff; border-radius: .875rem; box-shadow: var(--rf-ui-shadow); overflow: hidden; }
.rf-evidence-panel__header { display: flex; justify-content: space-between; align-items: center; gap: .7rem; border-bottom: 1px solid var(--rf-ui-border-soft); padding: 16px 18px; font-weight: 700; }
.rf-evidence-panel__body { padding: 18px; font-size: .875rem; }
.rf-evidence-panel__excerpt { background: #F3F7F8; border-left: 3px solid var(--rf-ui-primary); padding: .85rem 1rem; border-radius: 0 .5rem .5rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rf-empty { display: grid; place-items: center; text-align: center; gap: .75rem; padding: 32px 22px; color: var(--rf-ui-ink-soft); }
.rf-empty__title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--rf-ui-ink); }
.rf-empty__description { margin: 0; max-width: 45ch; font-size: .875rem; }
.rf-inline-notice { padding: 14px 17px; border-radius: .75rem; background: #F2F7F8; border: 1px solid #D6E6E8; color: #294A55; font-size: .875rem; }
.rf-inline-notice--warn { color: #694705; background: var(--rf-ui-amber-soft); border-color: #EED7A9; }
.rf-skeleton { background: linear-gradient(100deg,#E7EEF2 30%,#F6F8FA 50%,#E7EEF2 70%); background-size: 200% 100%; border-radius: .5rem; min-height: 18px; animation: rf-skeleton-move 1.4s linear infinite; }
@keyframes rf-skeleton-move { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.rf-chart { position: relative; min-height: 260px; width: 100%; }
.rf-chart--short { min-height: 190px; }
.rf-chart__empty { color: var(--rf-ui-ink-muted); min-height: inherit; display: grid; place-items: center; text-align: center; padding: 25px; }
.rf-scrollbox { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #9FB9C2 #EFF3F5; }
.rf-sidebar-backdrop { display: none; }
@media (max-width: 1250px) { .rf-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .rf-content-grid { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 992px) {
  .rf-shell { grid-template-columns: minmax(0,1fr); }
  .rf-sidebar { position: fixed; width: min(var(--rf-ui-sidebar-width), 88vw); transform: translateX(-110%); transition: transform .2s ease; box-shadow: var(--rf-ui-shadow-raised); }
  .rf-shell[data-sidebar-open="true"] .rf-sidebar { transform: translateX(0); }
  .rf-shell[data-sidebar-open="true"] .rf-sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(9,28,35,.48); z-index: 1035; }
  .rf-topbar__tools { flex-wrap: wrap; }
  .rf-context-select { min-width: 130px; }
}
@media (max-width: 620px) {
  .rf-kpi-grid { grid-template-columns: minmax(0,1fr); }
  .rf-workspace { padding: 15px 12px; }
  .rf-topbar { flex-wrap: wrap; }
  .rf-filterbar__search, .rf-filterbar__actions { flex-basis: 100%; }
  .rf-table-wrap { margin-inline: -4px; }
}
@media (prefers-reduced-motion: reduce) { .rf-skeleton { animation: none; } .rf-sidebar { transition: none; } }
