/* =====================================================
   Retos 360 — CSS completo
   Hereda variables CSS de nexo-edu
===================================================== */

/* ── WRAP ─────────────────────────────────────────── */
.r360-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

/* ── HEADER ──────────────────────────────────────── */
.r360-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ── HEATMAP ─────────────────────────────────────── */
.r360-historial-card { padding: 16px 20px; }
.r360-heatmap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.r360-heatmap__day {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--nexo-muted);
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--nexo-border);
  transition: transform .15s;
}
.r360-heatmap__day:hover { transform: scale(1.1); }
.r360-heatmap__day--none  { background: #f3f4f6; }
.r360-heatmap__day--low   { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.r360-heatmap__day--med   { background: #a7f3d0; border-color: #34d399; color: #065f46; }
.r360-heatmap__day--high  { background: #10b981; border-color: #059669; color: #fff; }

/* ── TABS DE ÁREAS ───────────────────────────────── */
.r360-area-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.r360-area-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--nexo-border);
  background: var(--nexo-bg-card);
  color: var(--nexo-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  position: relative;
}
.r360-area-tab:hover {
  border-color: var(--nexo-primary);
  color: var(--nexo-primary);
}
.r360-area-tab.active {
  background: var(--nexo-primary);
  border-color: var(--nexo-primary);
  color: #fff;
}
.r360-area-tab__icon { font-size: 16px; }
.r360-area-tab__badge {
  background: var(--nexo-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}
.r360-area-tab.active .r360-area-tab__badge {
  background: rgba(255,255,255,.3);
}

/* ── LISTA DE RETOS ──────────────────────────────── */
.r360-retos-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}
.r360-reto {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--nexo-bg-card);
  border: 1.5px solid var(--nexo-border);
  border-radius: var(--nexo-radius);
  padding: 16px;
  transition: border-color .2s, opacity .2s;
}
.r360-reto:hover {
  border-color: var(--nexo-primary);
  box-shadow: var(--nexo-shadow);
}
.r360-reto--done {
  opacity: .75;
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.r360-reto--done .r360-reto__title {
  text-decoration: line-through;
  color: var(--nexo-muted);
}

/* ── BOTÓN CHECK ─────────────────────────────────── */
.r360-reto__check {
  min-width: 42px;
  height: 42px;
  border-radius: 50% !important;
  padding: 0 !important;
  font-size: 18px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .15s, box-shadow .2s;
  background: #f3f4f6 !important;
  border: 2px solid #d1d5db !important;
  color: #9ca3af !important;
  cursor: pointer;
  position: relative;
}
.r360-reto__check::after {
  content: '✓';
  font-size: 18px;
  color: #9ca3af;
}
.r360-reto__check:hover {
  background: #e0e7ff !important;
  border-color: var(--nexo-primary) !important;
  box-shadow: 0 0 0 4px rgba(108,71,255,.1);
}
.r360-reto__check:hover::after {
  color: var(--nexo-primary);
}
.r360-reto--done .r360-reto__check {
  background: var(--nexo-success) !important;
  border-color: var(--nexo-success) !important;
}
.r360-reto--done .r360-reto__check::after {
  color: #fff;
}
.r360-reto__check:active { transform: scale(.88); }

.r360-reto__body  { flex: 1; min-width: 0; }
.r360-reto__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--nexo-text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.r360-reto__desc {
  font-size: 13px;
  color: var(--nexo-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.r360-reto__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.r360-reto__dif {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.r360-reto__pts { color: var(--nexo-muted); }

/* ══════════════════════════════════════════════════
   OBJETIVOS PERSONALES
══════════════════════════════════════════════════ */
.r360-objetivos-section {
  margin-top: 40px;
  border-top: 2px solid var(--nexo-border);
  padding-top: 32px;
}

.r360-objetivos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Stats de objetivos */
.r360-obj-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.r360-obj-stat {
  background: var(--nexo-bg-card);
  border: 1px solid var(--nexo-border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.r360-obj-stat--progress { border-color: #bfdbfe; background: #eff6ff; }
.r360-obj-stat--done     { border-color: #bbf7d0; background: #f0fdf4; }
.r360-obj-stat--pending  { border-color: #fde68a; background: #fffbeb; }
.r360-obj-stat__num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--nexo-text);
}
.r360-obj-stat__lbl {
  font-size: 11px;
  color: var(--nexo-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Formulario nuevo objetivo */
.r360-obj-form-card { margin-bottom: 20px; }

/* Lista de objetivos */
.r360-obj-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.r360-obj-empty {
  text-align: center;
  padding: 32px;
  background: #f9fafb;
  border: 2px dashed var(--nexo-border);
  border-radius: var(--nexo-radius);
  color: var(--nexo-muted);
  font-size: 14px;
}

/* Item de objetivo */
.r360-obj-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--nexo-bg-card);
  border: 1.5px solid var(--nexo-border);
  border-radius: var(--nexo-radius);
  padding: 16px;
  transition: box-shadow .2s;
}
.r360-obj-item:hover { box-shadow: var(--nexo-shadow); }
.r360-obj-item--logrado    { border-color: #bbf7d0; background: #f0fdf4; opacity: .8; }
.r360-obj-item--abandonado { opacity: .5; }
.r360-obj-item--en-progreso { border-color: #bfdbfe; }

.r360-obj-item__icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}
.r360-obj-item__body { flex: 1; min-width: 0; }
.r360-obj-item__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--nexo-text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.r360-obj-item--logrado .r360-obj-item__title {
  text-decoration: line-through;
  color: var(--nexo-muted);
}
.r360-obj-item__desc {
  font-size: 13px;
  color: var(--nexo-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}
.r360-obj-item__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}
.r360-obj-item__area {
  background: var(--nexo-bg);
  padding: 2px 8px;
  border-radius: 99px;
  color: var(--nexo-muted);
  font-weight: 500;
  border: 1px solid var(--nexo-border);
}
.r360-obj-item__fecha { color: var(--nexo-muted); }
.r360-obj-item__fecha.urgente { color: #d97706; font-weight: 600; }

.r360-obj-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Badge de estado */
.r360-obj-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.r360-obj-badge--pendiente   { background: #fef9c3; color: #854d0e; }
.r360-obj-badge--en-progreso { background: #dbeafe; color: #1d4ed8; }
.r360-obj-badge--logrado     { background: #dcfce7; color: #166534; }
.r360-obj-badge--abandonado  { background: #f3f4f6; color: #6b7280; }

/* Select de estado */
.r360-obj-estado-select {
  font-size: 12px !important;
  padding: 4px 8px !important;
  height: auto !important;
  min-width: 130px;
  cursor: pointer;
}

/* Botón eliminar */
.r360-obj-delete {
  background: none;
  border: none;
  color: #d1d5db;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .2s, background .2s;
}
.r360-obj-delete:hover {
  color: var(--nexo-error);
  background: #fee2e2;
}

/* ── TOAST ───────────────────────────────────────── */
.r360-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--nexo-text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  pointer-events: none;
  white-space: nowrap;
}
.r360-toast--success { background: var(--nexo-success); }
.r360-toast--error   { background: var(--nexo-error); }
.r360-toast--info    { background: var(--nexo-primary); }

/* ── MOBILE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .r360-wrap { padding: 20px 16px; }
  .r360-area-tab__lbl { display: none; }
  .r360-area-tab { padding: 9px 12px; gap: 0; }
  .r360-area-tab__icon { font-size: 20px; }
  .r360-heatmap__day { min-width: 28px; min-height: 28px; font-size: 10px; }
  .r360-reto { padding: 12px; }
  .r360-header { flex-direction: column; }
  .r360-obj-stats { grid-template-columns: repeat(2, 1fr); }
  .r360-obj-item { flex-wrap: wrap; }
  .r360-obj-item__actions { flex-direction: row; align-items: center; width: 100%; }
  .r360-objetivos-header { flex-direction: column; align-items: flex-start; }
}
