/* RewardWave — componentes compartidos entre secciones */

/* Encabezado de página */
.rw-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 4px;
}
.rw-page-title {
  font-family: var(--rw-font-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--rw-ink);
  display: block;
}
.rw-page-sub {
  font-size: 13.5px;
  color: var(--rw-muted);
  display: block;
}

/* Tarjeta de vidrio genérica */
.rw-card {
  background: var(--rw-glass-bg);
  backdrop-filter: blur(24px) saturate(185%);
  -webkit-backdrop-filter: blur(24px) saturate(185%);
  border: 1px solid var(--rw-glass-border);
  border-radius: var(--rw-radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--rw-glass-shadow);
}
.rw-stat-back-title { font-size: 12px; font-weight: 700; color: var(--rw-ink); }
.rw-stat-back-row {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--rw-muted);
}
.rw-stat-back-row b { font-weight: 700; color: var(--rw-ink); }

/* Tabs */
.rw-tabs {
  display: flex;
  gap: 6px;
  background: var(--rw-glass-bg);
  backdrop-filter: blur(20px) saturate(185%);
  -webkit-backdrop-filter: blur(20px) saturate(185%);
  border: 1px solid var(--rw-glass-border);
  border-radius: 16px;
  padding: 5px;
  overflow-x: auto;
  width: fit-content;
  max-width: 100%;
  box-shadow: var(--rw-glass-shadow-sm);
}
.rw-tab-btn {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 11px;
  font-family: var(--rw-font-display);
  font-weight: 600;
  font-size: 13px;
  background: transparent;
  color: var(--rw-muted);
  white-space: nowrap;
}
.rw-tab-btn:not(.is-active):hover { background: rgba(25, 149, 167, 0.1); color: var(--rw-ink); }
.rw-tab-btn.is-active {
  background: linear-gradient(150deg, var(--rw-teal), var(--rw-teal-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(25, 149, 167, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.rw-tabpanel.is-hidden { display: none; }
.rw-tabpanel { animation: rw-fade-in .45s var(--rw-ease); }
@keyframes rw-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Toolbar */
.rw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.rw-btn-primary {
  background: linear-gradient(150deg, var(--rw-teal), var(--rw-navy));
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 14px;
  font-family: var(--rw-font-display);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(25, 149, 167, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  white-space: nowrap;
}
.rw-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(25, 149, 167, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.rw-btn-secondary {
  background: var(--rw-glass-bg);
  backdrop-filter: blur(16px) saturate(185%);
  -webkit-backdrop-filter: blur(16px) saturate(185%);
  border: 1px solid var(--rw-glass-border);
  color: var(--rw-ink);
  padding: 10px 18px;
  border-radius: 14px;
  font-family: var(--rw-font-display);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--rw-glass-shadow-sm);
}
.rw-btn-secondary:hover { background: rgba(255, 255, 255, 0.75); transform: translateY(-1px); }
.rw-btn-ghost {
  background: transparent;
  border: none;
  color: var(--rw-teal-dark);
  font-family: var(--rw-font-display);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 4px;
}
.rw-btn-ghost:hover { color: var(--rw-navy); }

.rw-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--rw-glass-bg);
  backdrop-filter: blur(16px) saturate(185%);
  -webkit-backdrop-filter: blur(16px) saturate(185%);
  border: 1px solid var(--rw-glass-border);
  border-radius: 14px;
  padding: 9px 14px;
  min-width: 220px;
  flex: 1;
  max-width: 320px;
  box-shadow: var(--rw-glass-shadow-sm);
  transition: box-shadow .3s var(--rw-ease), border-color .3s var(--rw-ease);
}
.rw-search:focus-within { border-color: var(--rw-teal); box-shadow: 0 0 0 3px rgba(25, 149, 167, 0.15), var(--rw-glass-shadow-sm); }
.rw-search input, .rw-search textarea, .rw-search select {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--rw-ink);
  width: 100%;
  font-family: var(--rw-font-body);
}
.rw-search input::placeholder, .rw-search textarea::placeholder { color: var(--rw-muted-2); }

/* KPI row */
.rw-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.rw-kpi-card {
  background: var(--rw-glass-bg);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  border: 1px solid var(--rw-glass-border);
  border-radius: var(--rw-radius-md);
  padding: 16px 18px;
  box-shadow: var(--rw-glass-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rw-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--rw-glass-shadow); }
.rw-kpi-value { font-family: var(--rw-font-display); font-weight: 800; font-size: 25px; color: var(--rw-ink); }
.rw-kpi-label { font-size: 12px; color: var(--rw-muted); }
.rw-kpi-stars { color: var(--rw-coral); font-size: 15px; letter-spacing: 1px; }

/* Filter chips */
.rw-chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rw-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--rw-glass-bg);
  backdrop-filter: blur(14px) saturate(185%);
  -webkit-backdrop-filter: blur(14px) saturate(185%);
  border: 1px solid var(--rw-glass-border);
  font-family: var(--rw-font-display);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--rw-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: var(--rw-glass-shadow-sm);
}
.rw-chip:hover { background: rgba(255, 255, 255, 0.7); }
.rw-chip.is-active {
  background: linear-gradient(150deg, var(--rw-teal), var(--rw-teal-dark));
  border-color: var(--rw-teal);
  color: #fff;
  box-shadow: 0 6px 16px rgba(25, 149, 167, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.rw-chip-icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--rw-glass-bg); border: 1px solid var(--rw-glass-border);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  box-shadow: var(--rw-glass-shadow-sm);
}
.rw-chip-icon-btn:hover { transform: translateY(-1px) rotate(8deg); }

/* Table card */
.rw-table-card {
  background: var(--rw-glass-bg);
  backdrop-filter: blur(24px) saturate(185%);
  -webkit-backdrop-filter: blur(24px) saturate(185%);
  border: 1px solid var(--rw-glass-border);
  border-radius: var(--rw-radius-lg);
  box-shadow: var(--rw-glass-shadow);
  overflow: hidden;
}
.rw-table-scroll { overflow-x: auto; }
.rw-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.rw-table th {
  text-align: left;
  font-family: var(--rw-font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--rw-muted);
  padding: 14px 18px;
  border-bottom: 1px solid rgba(4, 47, 107, 0.08);
  background: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}
.rw-table td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(4, 47, 107, 0.06);
  color: var(--rw-ink);
  vertical-align: middle;
  transition: background-color .2s var(--rw-ease);
}
.rw-table tbody tr:last-child td { border-bottom: none; }
.rw-table tbody tr:hover td { background: rgba(25, 149, 167, 0.07); }
.rw-table-name { font-weight: 700; }
.rw-table-sub { color: var(--rw-muted); font-size: 12px; }

.rw-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid rgba(4, 47, 107, 0.06);
  font-size: 12.5px;
  color: var(--rw-muted);
}
.rw-pager { display: flex; gap: 4px; }
.rw-pager button {
  border: none; background: transparent; cursor: pointer;
  padding: 5px 9px; border-radius: 8px; font-size: 12.5px; color: var(--rw-muted); font-family: var(--rw-font-display); font-weight: 600;
}
.rw-pager button.is-active { background: var(--rw-teal); color: #fff; }

/* Badges */
.rw-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.rw-badge-teal { background: rgba(25, 149, 167, 0.14); color: var(--rw-teal-dark); }
.rw-badge-coral { background: rgba(219, 74, 43, 0.12); color: var(--rw-coral); }
.rw-badge-muted { background: rgba(91, 107, 120, 0.12); color: var(--rw-muted); }
.rw-badge-navy { background: rgba(4, 47, 107, 0.1); color: var(--rw-navy); }

/* Row icon actions */
.rw-row-actions { display: flex; gap: 6px; }
.rw-icon-action {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid rgba(4, 47, 107, 0.1);
  background: rgba(255, 255, 255, 0.55);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.rw-icon-action:hover { background: rgba(25, 149, 167, 0.16); transform: translateY(-1px); }

/* Generic list row (ubicaciones, gerentes) */
.rw-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rw-list-row {
  background: var(--rw-glass-bg);
  backdrop-filter: blur(20px) saturate(185%);
  -webkit-backdrop-filter: blur(20px) saturate(185%);
  border: 1px solid var(--rw-glass-border);
  border-radius: var(--rw-radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--rw-glass-shadow-sm);
}
.rw-list-row:hover { transform: translateY(-2px); box-shadow: var(--rw-glass-shadow); }
.rw-list-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rw-list-avatar {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, rgba(25,149,167,.2), rgba(4,47,107,.14));
  color: var(--rw-navy); font-family: var(--rw-font-display); font-weight: 700; font-size: 14px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6);
}
.rw-list-title { font-weight: 700; font-size: 14px; color: var(--rw-ink); }
.rw-list-sub { font-size: 12.5px; color: var(--rw-muted); }
.rw-list-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Page section title */
.rw-section-title {
  font-family: var(--rw-font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--rw-ink);
}
.rw-section-hint { font-size: 12.5px; color: var(--rw-muted-2); }

/* Empty small state (used inline, not full page) */
.rw-empty-inline {
  padding: 40px 20px;
  text-align: center;
  color: var(--rw-muted);
  font-size: 13.5px;
}

/* Phone mockup */
.rw-phone {
  width: 240px;
  border-radius: 40px;
  border: 8px solid var(--rw-ink);
  background: #fff;
  box-shadow: 0 20px 50px rgba(4, 47, 107, 0.22), inset 0 0 0 2px rgba(255,255,255,.06);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.rw-phone-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 90px; height: 18px; background: var(--rw-ink); border-radius: 0 0 14px 14px; z-index: 2;
}
.rw-phone-screen { height: 420px; background: linear-gradient(180deg, #eef6f7, #fff); padding: 30px 12px 12px; position: relative; }
.rw-phone-push {
  background: rgba(11, 31, 51, 0.92);
  backdrop-filter: blur(6px);
  color: #fff;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  display: flex;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.rw-phone-push-icon {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--rw-teal), var(--rw-navy));
}

/* Toggle switch */
.rw-switch { position: relative; display: inline-block; width: 40px; height: 23px; flex-shrink: 0; }
.rw-switch input { opacity: 0; width: 0; height: 0; }
.rw-switch-track {
  position: absolute; inset: 0; background: rgba(91,107,120,.28); border-radius: 999px; cursor: pointer;
}
.rw-switch-track::before {
  content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform .35s var(--rw-ease-spring);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.rw-switch input:checked + .rw-switch-track { background: linear-gradient(135deg, var(--rw-teal), var(--rw-teal-dark)); }
.rw-switch input:checked + .rw-switch-track::before { transform: translateX(17px); }

@media (max-width: 640px) {
  .rw-table { min-width: 560px; }
  .rw-phone { width: 200px; }
  .rw-phone-screen { height: 360px; }
}

/* =====================================================================
   Tema v2 para los componentes compartidos (2026-10-02)
   Naranja = acción principal y selección; celeste = apoyo/positivo; azul = detalle.
   ===================================================================== */
.rw-page-head { padding: 18px 0 2px; align-items: flex-end; }
.rw-page-title { font-family: var(--v2-display); font-weight: 800; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.02; letter-spacing: -0.045em; color: var(--v2-ink); }
.rw-page-sub { font-size: 15px; color: var(--v2-ink-2); margin-top: 6px; line-height: 1.5; }
.rw-section-title { font-family: var(--v2-display); font-weight: 800; letter-spacing: -0.02em; color: var(--v2-ink); }
.rw-section-hint { color: var(--v2-muted); }

/* Tarjetas: blancas, borde suave */
.rw-card, .rw-kpi-card, .rw-table-card, .rw-list-row, .rw-stat-card, .rw-summary-card {
  background: var(--v2-surface); border: 1px solid var(--v2-line); box-shadow: var(--v2-shadow);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.rw-card { border-radius: var(--v2-radius); }
.rw-table-card { border-radius: var(--v2-radius); }
.rw-kpi-card { border-radius: 20px; }
.rw-kpi-value { font-family: var(--v2-display); font-weight: 800; letter-spacing: -0.04em; font-size: 28px; }
.rw-kpi-label { font-size: 13px; font-weight: 600; color: var(--v2-muted); }

/* Botones en píldora con brillo */
.rw-btn-primary {
  background: var(--v2-orange); color: #fff; border-radius: 999px; padding: 11px 20px; font-family: var(--v2-display); font-weight: 800;
  box-shadow: 0 10px 24px rgba(227,85,47,.32); border: none;
}
.rw-btn-primary:hover { background: #d84c27; box-shadow: 0 14px 28px rgba(227,85,47,.4); transform: translateY(-1px); color: #fff; text-decoration: none; }
.rw-btn-secondary {
  background: var(--v2-surface); color: var(--v2-ink); border: 1px solid var(--v2-line); border-radius: 999px; padding: 10px 18px;
  font-family: var(--v2-display); font-weight: 700; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.rw-btn-secondary:hover { background: var(--v2-surface); border-color: rgba(227,85,47,.45); color: var(--v2-ink); transform: translateY(-1px); text-decoration: none; }
.rw-btn-ghost { color: var(--v2-orange-ink); font-weight: 700; }
.rw-btn-ghost:hover { color: #c43f1c; }

/* Pestañas: píldora blanca, activa en naranja */
.rw-tabs { background: var(--v2-surface); border: 1px solid var(--v2-line); border-radius: 999px; padding: 5px; box-shadow: var(--v2-shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
.rw-tab-btn { border-radius: 999px; padding: 9px 16px; font-weight: 700; color: var(--v2-ink-2); font-family: var(--v2-display); }
.rw-tab-btn:not(.is-active):hover { background: var(--v2-bg); color: var(--v2-ink); }
.rw-tab-btn.is-active { background: var(--v2-orange); color: #fff; box-shadow: 0 8px 18px rgba(227,85,47,.32); }

/* Búsqueda y campos */
.rw-search { background: var(--v2-surface); border: 1px solid var(--v2-line); border-radius: 999px; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.rw-search:focus-within { border-color: var(--v2-orange); box-shadow: 0 0 0 3px rgba(227,85,47,.12); }
textarea.rw-search, select.rw-search { border-radius: 14px; }

/* Fichas y chips */
.rw-chip { background: var(--v2-surface); border: 1px solid var(--v2-line); box-shadow: none; color: var(--v2-ink-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.rw-chip.is-active { background: var(--v2-orange); border-color: var(--v2-orange); color: #fff; box-shadow: 0 6px 14px rgba(227,85,47,.3); }
.rw-chip-icon-btn { background: var(--v2-surface); border: 1px solid var(--v2-line); box-shadow: none; }
.rw-badge { border-radius: 999px; font-weight: 800; padding: 4px 10px; }
.rw-badge-coral { background: var(--v2-orange-soft); color: var(--v2-orange); }
.rw-badge-teal { background: var(--v2-cyan-soft); color: #0a6f7d; }
.rw-badge-navy { background: var(--v2-blue-soft); color: var(--v2-blue); }

/* Tablas */
.rw-table th { background: #faf9f8; color: var(--v2-muted); font-family: var(--v2-display); font-weight: 700; letter-spacing: .05em; border-bottom: 1px solid var(--v2-line); }
.rw-table td { border-bottom: 1px solid #f0eeeb; }
.rw-table tbody tr:hover td { background: #fbf9f7; }
.rw-pager button.is-active { background: var(--v2-orange); color: #fff; border-radius: 999px; }

/* Interruptores: encendido en celeste (estado positivo) */
.rw-switch input:checked + .rw-switch-track { background: var(--v2-cyan); }

/* Acciones de fila */
.rw-icon-action { background: var(--v2-surface); border: 1px solid var(--v2-line); border-radius: 10px; color: var(--v2-ink-2); }
.rw-icon-action:hover { color: var(--v2-orange); border-color: rgba(227,85,47,.4); }

/* Listas */
.rw-list-row { border-radius: 16px; }
.rw-list-avatar { background: var(--v2-orange-soft); color: var(--v2-orange); }

@media (max-width: 640px) {
  .rw-page-title { font-size: clamp(28px, 9vw, 36px); }
  .rw-page-head { padding-top: 10px; }
  .rw-tabs { max-width: 100%; }
}

/* Selector "Configuración | Vista previa" (pantallas angostas). Cada página lo muestra en su punto de quiebre. */
.rw-viewswitch {
  display: none; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border-radius: 999px;
  background: var(--v2-surface); border: 1px solid var(--v2-line); box-shadow: var(--v2-shadow);
}
.rw-viewswitch button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; background: transparent; cursor: pointer;
  border-radius: 999px; padding: 10px 12px; font-family: var(--v2-display); font-weight: 700; font-size: 14px; color: var(--v2-ink-2);
}
.rw-viewswitch button.is-active { background: var(--v2-orange); color: #fff; box-shadow: 0 8px 18px rgba(227,85,47,.3); }
.rw-viewswitch svg { width: 16px; height: 16px; flex-shrink: 0; }
