/* RM Dashboard · Shared styles · 22 May 2026 */

:root {
  --rm-green: #1A6630;
  --rm-green-dark: #0F4019;
  --rm-green-light: #4A9B5F;
  --rm-gold: #D4AF37;
  --rm-gold-light: #F5E5B8;
  --bg-cream: #FAFAF7;
  --bg-white: #FFFFFF;
  --text-dark: #1A1A1A;
  --text-muted: #6B7280;
  --border-soft: #E5E7EB;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-cream);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

.tabular-nums { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  border: 1px solid #F3F4F6;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.kpi-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi-delta { font-size: 12px; font-weight: 500; }
.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }
.delta-neutral { color: var(--text-muted); }

.badge-pending {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; background: #FEF3C7; color: #92400E;
  border-radius: 9999px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-green   { background:#D1FAE5; color:#065F46; }
.badge-yellow  { background:#FEF3C7; color:#92400E; }
.badge-red     { background:#FEE2E2; color:#991B1B; }
.badge-gray    { background:#F3F4F6; color:#374151; }
.badge-base { padding:2px 8px; border-radius:9999px; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.05em; display:inline-block; }

/* Funnel */
.funnel-bar {
  height: 56px; border-radius: 8px; display: flex; align-items: center;
  padding: 0 20px; color: #fff; font-weight: 600;
  font-variant-numeric: tabular-nums; transition: transform 0.2s;
}
.funnel-bar:hover { transform: scale(1.02); }
.funnel-arrow { text-align: center; color: var(--text-muted); font-size: 12px; padding: 8px 0; font-variant-numeric: tabular-nums; }

/* Period pills */
.period-pill {
  padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.period-pill:hover { background: #F3F4F6; }
.period-pill.active { background: var(--rm-green); color: #fff; }

/* WF Status dots */
.wf-dot {
  width: 100%; aspect-ratio: 1; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
  transition: transform 0.15s; border: 2px solid transparent;
}
.wf-dot:hover { transform: scale(1.1); }
.wf-dot.green { background: #D1FAE5; border-color: var(--success); color: #065F46; }
.wf-dot.yellow { background: #FEF3C7; border-color: var(--warning); color: #92400E; }
.wf-dot.red { background: #FEE2E2; border-color: var(--danger); color: #991B1B; }
.wf-dot.inactive { background: #F3F4F6; border-color: #9CA3AF; color: #6B7280; }

/* Kanban */
.kanban-col {
  background: var(--bg-cream); border-radius: 12px; padding: 12px;
  min-height: 200px; border: 1px solid var(--border-soft);
}
.kanban-card {
  background: var(--bg-white); border-radius: 8px; padding: 12px;
  border-left: 3px solid var(--text-muted);
  margin-bottom: 8px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.15s;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.08); }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 4px; line-height: 1.3; }
.kanban-card-meta { font-size: 11px; color: var(--text-muted); }
.kanban-card-amount { font-size: 14px; font-weight: 700; color: var(--rm-green); font-variant-numeric: tabular-nums; }

/* Activity feed */
.activity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.activity-row:last-child { border-bottom: 0; }
.activity-ts { color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 50px; }
.activity-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.activity-status.success { background: var(--success); }
.activity-status.error { background: var(--danger); }
.activity-status.waiting { background: var(--warning); }

/* Heatmap */
.heatmap-cell {
  aspect-ratio: 1; border-radius: 3px;
  background: var(--bg-cream); transition: transform 0.15s;
  cursor: pointer; min-height: 18px;
}
.heatmap-cell:hover { transform: scale(1.2); z-index: 10; position: relative; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* Loading skeleton */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* Toast */
.toast {
  position: fixed; top: 20px; right: 20px;
  background: var(--text-dark); color: #fff;
  padding: 12px 20px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999; font-size: 13px;
  animation: slideIn 0.2s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ============ REPORTS PAGE (Looker Studio) ============ */

/* Sub-nav de reportes (Executive / Marketing / Pipeline / Custom) */
.sub-nav {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0;
}
.sub-nav-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sub-nav-tab:hover { color: var(--text-dark); background: var(--bg-cream); }
.sub-nav-tab.active {
  color: var(--rm-gold); border-bottom-color: var(--rm-gold);
  font-weight: 600;
}
.sub-nav-tab:focus-visible {
  outline: 2px solid var(--rm-green); outline-offset: -2px; border-radius: 4px;
}

/* Toolbar (header del reporte + acciones) */
.report-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 4px 0;
}
.report-meta h2 { margin: 0; }
.report-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px;
  background: var(--bg-white); border: 1px solid var(--border-soft);
  font-size: 13px; font-weight: 500; color: var(--text-dark);
  cursor: pointer; transition: all 0.15s;
}
.action-btn:hover { background: var(--bg-cream); border-color: var(--rm-gold); }
.action-btn:focus-visible { outline: 2px solid var(--rm-green); outline-offset: 2px; }
.action-btn:active { transform: translateY(1px); }

/* Contenedor del iframe Looker */
.report-container { min-height: 500px; background: var(--bg-cream); }
.report-container iframe { display: block; width: 100%; border: 0; }

/* Placeholder cuando reporte aún no está configurado */
.report-pending {
  max-width: 720px; margin: 0 auto; padding: 48px 32px;
  text-align: center;
}
.pending-icon { font-size: 56px; line-height: 1; margin-bottom: 16px; }
.pending-title {
  font-size: 22px; font-weight: 700; color: var(--text-dark);
  margin: 0 0 8px 0; letter-spacing: -0.01em;
}
.pending-desc {
  font-size: 14px; color: var(--text-muted);
  margin: 0 0 32px 0; line-height: 1.5;
}
.pending-kpis, .pending-steps {
  text-align: left; background: var(--bg-cream);
  border-radius: 12px; padding: 20px 24px;
  margin: 16px 0;
  border-left: 3px solid var(--rm-gold);
}
.pending-kpis h3, .pending-steps h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--rm-green);
  margin: 0 0 12px 0;
}
.pending-kpis ul, .pending-steps ol {
  margin: 0; padding-left: 20px;
  font-size: 13px; color: var(--text-dark); line-height: 1.7;
}
.pending-steps ol > li { margin-bottom: 8px; }
.pending-steps code {
  background: var(--bg-white); padding: 1px 6px;
  border-radius: 4px; font-size: 12px;
  border: 1px solid var(--border-soft);
  color: var(--rm-green-dark);
}
.pending-steps a { color: var(--rm-green); text-decoration: underline; }
.pending-cta {
  display: inline-block; margin-top: 24px;
  padding: 12px 24px; background: var(--rm-gold); color: #fff;
  font-weight: 600; font-size: 14px;
  border-radius: 8px; text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}
.pending-cta:hover { background: #C49B2F; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4); }

/* ============ Mobile / Responsive ============ */
@media (max-width: 768px) {
  .kpi-value { font-size: 24px; }
  .desktop-only { display: none !important; }
  .funnel-bar { height: 44px; padding: 0 12px; font-size: 12px; }

  /* Reports responsive */
  .sub-nav-tab { padding: 8px 10px; font-size: 12px; }
  .report-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .report-actions { justify-content: stretch; }
  .action-btn { flex: 1; justify-content: center; padding: 10px 8px; }
  .report-pending { padding: 32px 20px; }
  .pending-title { font-size: 18px; }
  .pending-kpis, .pending-steps { padding: 16px; }
  .report-container iframe { min-height: 800px; }
}

@media (max-width: 480px) {
  .sub-nav-tab { padding: 8px 8px; font-size: 11px; }
  .sub-nav-tab .mr-1 { display: none; } /* ocultar icono en pantallas mini */
}
