/* ──────────────────────────────────────────────────────────────────────────
   Mente — "dentro de tu cabeza".
   Tablero de proyectos como esferas flotantes (motor canvas en mente.js).
   Todo va con prefijo .mente- y scope bajo .mente-stage para no tocar el
   design system de la app.
   ────────────────────────────────────────────────────────────────────────── */

.mente-root { width: 100%; }

.mente-stage {
  position: relative;
  width: 100%;
  height: clamp(520px, calc(100vh - 168px), 1080px);
  overflow: hidden;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, .24);
  user-select: none;
  box-shadow: 0 24px 60px -34px rgba(15, 23, 42, 0.32);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.mente-stage canvas { position: absolute; inset: 0; display: block; touch-action: none; }
.mente-stage * { box-sizing: border-box; }
.mente-stage ul { list-style: none; margin: 0; padding: 0; }

/* top bar */
.mente-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 18px; z-index: 3; pointer-events: none;
}
.mente-ttl { font-size: 14px; font-weight: 600; letter-spacing: .04em; color: #172033; }
.mente-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.mente-acts { display: flex; gap: 9px; align-items: center; pointer-events: auto; }
.mente-btn {
  font-size: 12px; color: #243247;
  background: rgba(255,255,255,.9); border: 1px solid rgba(148,163,184,.38);
  border-radius: 10px; padding: 8px 13px; cursor: pointer; line-height: 1;
  font-family: inherit; box-shadow: 0 8px 22px -18px rgba(15,23,42,.55);
}
.mente-btn:hover { background: #f1f5f9; border-color: rgba(100,116,139,.42); }
.mente-btn.on { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.42); color: #047857; }
.mente-btn-primary { background: #243247; border-color: #243247; color: #fff; }
.mente-btn-primary:hover { background: #111827; border-color: #111827; }
.mente-egg {
  font-size: 15px; line-height: 1; padding: 6px; cursor: pointer;
  background: transparent; border: none; border-radius: 9px;
  opacity: .22; transition: opacity .18s, background .18s; filter: grayscale(.4);
}
.mente-egg:hover { opacity: .6; }
.mente-egg.on { opacity: 1; filter: none; background: rgba(255,138,69,.16); }

/* hover card */
.mente-card {
  position: absolute; display: none; min-width: 188px; max-width: 240px; z-index: 4;
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border: 1px solid rgba(148,163,184,.28); border-radius: 15px; padding: 13px 14px;
  color: #172033; pointer-events: none; box-shadow: 0 16px 38px -24px rgba(15,23,42,.48);
}
.mente-card-row { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.mente-card-area { justify-content: flex-start; }
.mente-card-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
#menteCardArea { font-size: 11px; color: #64748b; }
#menteCardName { font-size: 15px; font-weight: 500; line-height: 1.3; margin: 8px 0 12px; }
.mente-lbl { font-size: 11px; color: #64748b; }
#menteCardProg { font-size: 12px; font-weight: 500; }
.mente-bar { height: 5px; border-radius: 3px; background: #e2e8f0; overflow: hidden; margin: 5px 0 12px; }
#menteCardBar { height: 100%; width: 0%; border-radius: 3px; }
.mente-urg { display: flex; gap: 3px; }

/* legend */
.mente-legend {
  position: absolute; bottom: 0; left: 0; right: 0; display: flex; flex-wrap: wrap;
  gap: 16px; padding: 14px 20px; z-index: 3; font-size: 11px; color: #64748b;
  pointer-events: none;
}
.mente-legend b { color: #172033; font-weight: 600; }

.mente-emptyhint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 3; text-align: center; font-size: 14px; color: #64748b;
  pointer-events: none;
}
.mente-emptyhint strong { color: #243247; font-weight: 600; }

/* drawer */
.mente-drawer {
  position: absolute; top: 0; right: 0; height: 100%; width: min(560px, 96%); z-index: 6;
  background: #fff; backdrop-filter: blur(16px);
  border-left: 1px solid rgba(148,163,184,.32);
  transform: translateX(100%); transition: transform .34s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; color: #172033;
  box-shadow: -28px 0 64px -44px rgba(15,23,42,.62);
}
.mente-drawer.open { transform: translateX(0); }
.mente-dclose {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px;
  background: #f1f5f9; border: 1px solid rgba(148,163,184,.28); color: #475569;
  font-size: 18px; line-height: 1; cursor: pointer; z-index: 2;
}
.mente-dclose:hover { background: #e2e8f0; }
.mente-dhead {
  padding: 24px 28px 18px;
  border-bottom: 1px solid rgba(148,163,184,.22);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.mente-dtop { display: flex; gap: 18px; align-items: flex-start; }
.mente-dwho { flex: 1; min-width: 0; padding-right: 24px; }
.mente-darearow { display: flex; align-items: center; gap: 7px; }
.mente-ddot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
#menteDArea { background: transparent; border: none; color: #64748b; font-size: 12px; cursor: pointer; outline: none; font-family: inherit; }
#menteDArea option { color: #000; }
#menteDName {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid transparent;
  color: #111827; font-size: 21px; font-weight: 650; padding: 6px 0 4px; outline: none; font-family: inherit;
}
#menteDName:focus { border-bottom-color: rgba(79,70,229,.34); }
.mente-dring { position: relative; width: 56px; height: 56px; flex: none; }
#menteRingTxt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #172033; }
.mente-dring svg circle:first-child { stroke: rgba(15,23,42,.12); }
.mente-stepcount { font-size: 12px; color: #64748b; margin-top: 10px; }
.mente-dctrls {
  margin-top: 16px; display: flex; flex-direction: column; gap: 11px;
  padding: 14px; background: #fff; border: 1px solid rgba(148,163,184,.24);
  border-radius: 14px; box-shadow: 0 12px 34px -28px rgba(15,23,42,.42);
}
.mente-ctrl { display: flex; align-items: center; gap: 10px; }
.mente-ctrl label { font-size: 12px; color: #475569; width: 104px; flex: none; font-weight: 600; }
.mente-ctrl input[type=range] { flex: 1; min-width: 0; height: 4px; }
#menteImpR { accent-color: #7c8cff; }
#menteUrgR { accent-color: #ff8a5c; }
.mente-val { font-size: 12px; width: 34px; text-align: right; color: #172033; font-weight: 600; }
.mente-ctrl input[type=date] {
  flex: 1; min-width: 0; background: #fff; border: 1px solid rgba(148,163,184,.38);
  border-radius: 8px; color: #172033; font-size: 12px; padding: 7px 9px; outline: none; color-scheme: light; font-family: inherit;
}

.mente-dbody { flex: 1; overflow-y: auto; padding: 18px 28px 36px; background: #f8fafc; }
.mente-dbody::-webkit-scrollbar { width: 8px; }
.mente-dbody::-webkit-scrollbar-thumb { background: rgba(100,116,139,.24); border-radius: 4px; }
.mente-sec {
  padding: 18px; border: 1px solid rgba(148,163,184,.24); border-radius: 14px;
  background: #fff; margin-bottom: 16px; box-shadow: 0 12px 34px -30px rgba(15,23,42,.46);
}
.mente-sec:first-child { border-top: 1px solid rgba(148,163,184,.24); }
.mente-danger-sec { border-color: rgba(248,113,113,.38); background: #fffafa; }
.mente-stage .mente-danger-sec h3 { color: #b42318; }
.mente-stage .mente-sec h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #475569;
  font-weight: 700; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center;
}
.mente-cnt { color: #94a3b8; font-weight: 600; letter-spacing: 0; text-transform: none; }
.mente-empty { font-size: 13px; color: #94a3b8; padding: 4px 0; }

.mente-stepwrap {
  border: 1px solid rgba(148,163,184,.22); border-radius: 12px; background: #f8fafc;
  margin-bottom: 9px; overflow: hidden;
}
.mente-step-head { display: flex; align-items: center; gap: 11px; padding: 12px; cursor: pointer; border-radius: 0; }
.mente-step-head:hover { background: #eef4fb; }
.mente-schk { width: 17px; height: 17px; accent-color: #5dd6a8; flex: none; cursor: pointer; }
.mente-step-head .mente-txt { flex: 1; font-size: 13.5px; line-height: 1.4; color: #172033; }
.mente-step-head.done .mente-txt { text-decoration: line-through; color: #94a3b8; }
.mente-badges { display: flex; gap: 8px; flex: none; }
.mente-bdg { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #64748b; }
.mente-caret { flex: none; color: #94a3b8; transition: transform .18s; display: flex; }
.mente-step-head.open .mente-caret { transform: rotate(90deg); }
.mente-del { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 3px; display: flex; flex: none; border-radius: 6px; }
.mente-del:hover { color: #ff7a6b; background: rgba(255,122,107,.12); }
.mente-step-exp { padding: 12px 14px 15px 40px; border-top: 1px solid rgba(148,163,184,.18); background: #fff; }
.mente-addrow { display: flex; gap: 8px; margin-top: 12px; }
.mente-addrow input {
  flex: 1; min-width: 0; background: #fff; border: 1px solid rgba(148,163,184,.32);
  border-radius: 9px; color: #172033; font-size: 13px; padding: 9px 11px; outline: none; font-family: inherit;
}
.mente-addrow input:focus { border-color: rgba(79,70,229,.42); box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.mente-addrow button { background: #243247; border: 1px solid #243247; color: #fff; border-radius: 9px; padding: 0 13px; cursor: pointer; font-size: 18px; line-height: 1; }
.mente-addrow button:hover { background: #111827; }

.mente-drop { border: 1px dashed rgba(100,116,139,.34); border-radius: 10px; padding: 12px; text-align: center; font-size: 11.5px; color: #64748b; cursor: pointer; transition: .15s; background: #f8fafc; }
.mente-drop:hover { border-color: rgba(79,70,229,.42); color: #243247; background: #f3f6fb; }
.mente-drop.drag { border-color: #10b981; background: rgba(16,185,129,.08); color: #047857; }
.mente-file { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.mente-fic { width: 32px; height: 32px; border-radius: 7px; background: #eef2f7; display: flex; align-items: center; justify-content: center; color: #64748b; flex: none; }
.mente-thumb { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; flex: none; }
.mente-fmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mente-fn { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mente-fn a { color: inherit; text-decoration: none; }
.mente-fn a:hover { text-decoration: underline; }
.mente-fs { font-size: 11px; color: #94a3b8; }

.mente-cm { display: flex; gap: 10px; padding: 9px 0; }
.mente-av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; flex: none; color: #fff; }
.mente-cbody { flex: 1; min-width: 0; }
.mente-cmeta { font-size: 11px; color: #64748b; display: block; margin-bottom: 2px; }
.mente-ctxt { font-size: 13px; line-height: 1.45; display: block; }
.mente-cmbox { margin-top: 8px; }
.mente-cmbox textarea {
  width: 100%; background: #fff; border: 1px solid rgba(148,163,184,.32);
  border-radius: 10px; color: #172033; font-size: 13px; padding: 9px 11px; outline: none; resize: vertical;
  min-height: 46px; font-family: inherit;
}
.mente-cmbox textarea:focus { border-color: rgba(79,70,229,.42); box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.mente-cmbox button { margin-top: 7px; background: #10b981; color: #052e1d; border: none; border-radius: 9px; padding: 7px 14px; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.mente-cmbox button:hover { background: #34d399; }
.mente-expsub { font-size: 11px; color: #64748b; margin: 14px 0 7px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

#menteTags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.mente-tag { display: inline-flex; align-items: center; gap: 5px; background: #eef2f7; border: 1px solid rgba(148,163,184,.2); border-radius: 20px; padding: 5px 6px 5px 11px; font-size: 12px; color: #334155; }
.mente-tag button { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.mente-tag button:hover { color: #ff7a6b; }
#menteTagInput { background: #fff; border: 1px solid rgba(148,163,184,.32); border-radius: 20px; color: #172033; font-size: 12px; padding: 6px 11px; outline: none; width: 132px; font-family: inherit; }
#menteTagInput:focus { border-color: rgba(79,70,229,.42); box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
#menteDelProj { width: 100%; margin-top: 2px; background: #fff5f5; border: 1px solid #fecaca; color: #b42318; border-radius: 10px; padding: 11px; cursor: pointer; font-size: 13px; font-weight: 700; font-family: inherit; }
#menteDelProj:hover { background: #fee2e2; }

/* hoop control panel (easter egg) */
.mente-hooppanel {
  position: absolute; left: 16px; bottom: 52px; z-index: 5; display: none; width: 242px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border: 1px solid rgba(148,163,184,.28); border-radius: 14px; padding: 13px 14px; color: #172033;
  box-shadow: 0 16px 38px -26px rgba(15,23,42,.48);
}
.mente-hooppanel.show { display: block; }
.mente-hphead { font-size: 12px; font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
#menteHoopReset { font-size: 11px; background: #f1f5f9; border: 1px solid rgba(148,163,184,.32); color: #475569; border-radius: 7px; padding: 3px 9px; cursor: pointer; font-family: inherit; }
#menteHoopReset:hover { background: #e2e8f0; }
.mente-hctrl { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.mente-hctrl label { font-size: 11px; color: #475569; width: 72px; flex: none; }
.mente-hctrl input[type=range] { flex: 1; min-width: 0; width: 100%; height: 4px; accent-color: #ff8a45; }
.mente-hphint { font-size: 11px; color: #64748b; margin-top: 6px; }

@media (max-width: 720px) {
  .mente-top { flex-direction: column; gap: 10px; }
  .mente-acts { flex-wrap: wrap; }
  .mente-stage { height: clamp(460px, calc(100vh - 140px), 900px); }
  .mente-drawer { width: 100%; }
  .mente-dhead { padding: 22px 20px 16px; }
  .mente-dbody { padding: 16px 16px 28px; }
  .mente-ctrl { align-items: flex-start; flex-direction: column; gap: 6px; }
  .mente-ctrl label { width: auto; }
}
