:root{
  --bg:#f5f6fa;
  --surface:#ffffff;
  --ink:#1e293b;
  --ink-2:#40566e;
  --muted:#64748b;
  --muted-2:#94a3b8;
  --line:#e2e8f0;
  --line-2:#f1f5f9;
  --brand:#E0024D;
  --brand-2:#E60050;
  --brand-soft:#fff0f5;
  --blue:#4a76c0;
  --cyan:#1fceff;
  --violet:#7c5cbf;
  --ok:#16a34a;
  --ok-soft:#ecfdf5;
  --warn:#d97706;
  --bad:#e11d48;
  --radius:16px;
  --radius-lg:24px;
  --radius-pill:999px;
  --side:84px;
  --top:72px;
  --font:"Barlow",system-ui,-apple-system,sans-serif;
  --shadow:0 8px 24px rgba(15,23,42,.06);
  --shadow-sm:0 2px 8px rgba(15,23,42,.04);
  --grad:linear-gradient(100deg,#E0024D 0%,#7c5cbf 55%,#4a76c0 100%);
  --grad-btn:linear-gradient(100deg,#E0024D,#7c5cbf);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;font-family:var(--font);color:var(--ink);line-height:1.55;font-size:15px;
  background:var(--bg);min-height:100vh;-webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
img{max-width:100%;display:block}
h1,h2,h3,h4{font-weight:700;letter-spacing:-.02em;line-height:1.15;margin:0;color:var(--ink)}
p{margin:0}
.muted{color:var(--muted)}
.small{font-size:.875rem}
.tiny{font-size:.75rem}
.brand-text{color:var(--brand)}
.grad-text{
  background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent;
}

/* Shell: narrow icon sidebar + topbar */
.app-shell{display:grid;grid-template-columns:var(--side) 1fr;min-height:100vh}
.sidebar{
  position:sticky;top:0;height:100vh;width:var(--side);
  background:var(--surface);border-right:1px solid var(--line);
  display:flex;flex-direction:column;align-items:center;padding:.85rem .5rem 1rem;gap:.5rem;z-index:40;
}
.sidebar-logo{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;overflow:hidden;margin-bottom:.4rem}
.sidebar-logo img{width:36px;height:auto}
.side-nav{display:flex;flex-direction:column;align-items:center;gap:.35rem;flex:1;width:100%}
.side-link{
  width:48px;height:48px;border-radius:14px;display:grid;place-items:center;
  color:var(--muted);border:1px solid transparent;transition:.15s ease;
  position:relative;
}
.side-link svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.side-link:hover{background:var(--brand-soft);color:var(--brand)}
.side-link.active{background:var(--brand-soft);color:var(--brand);border-color:rgba(224,2,77,.18)}
.side-link.active::before{
  content:"";position:absolute;left:-6px;width:3px;height:22px;border-radius:4px;background:var(--brand);
}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:.35rem;align-items:center}

.workspace{min-width:0;display:flex;flex-direction:column;min-height:100vh}
.topbar{
  position:sticky;top:0;z-index:30;min-height:var(--top);
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.9rem 1.75rem;background:rgba(245,246,250,.92);backdrop-filter:blur(10px);
  border-bottom:1px solid transparent;
}
.topbar-title{font-size:1.55rem;font-weight:800;letter-spacing:-.03em}
.topbar-title .accent{color:var(--brand)}
.topbar-actions{display:flex;align-items:center;gap:.55rem}
.icon-chip{
  width:40px;height:40px;border-radius:50%;border:1px solid var(--line);background:var(--surface);
  display:grid;place-items:center;color:var(--muted);
}
.icon-chip svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8}
.avatar{
  width:40px;height:40px;border-radius:50%;background:var(--brand);color:#fff;
  display:grid;place-items:center;font-weight:700;font-size:.95rem;
}
.main{padding:0 1.75rem 3rem;max-width:1180px;width:100%}
.page-sub{color:var(--muted);margin:.35rem 0 1.25rem;max-width:52rem}

.mobile-bar{display:none}

@media(max-width:900px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{display:none}
  .mobile-bar{
    display:flex;position:sticky;top:0;z-index:40;align-items:center;justify-content:space-between;
    padding:.75rem 1rem;background:var(--surface);border-bottom:1px solid var(--line);
  }
  .topbar{padding:.85rem 1rem}
  .main{padding:0 1rem 2.5rem}
  .topbar-title{font-size:1.25rem}
}

/* Cards & grids */
.card{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:1.15rem 1.2rem;box-shadow:var(--shadow-sm);
}
.card.flat{box-shadow:none}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.75rem}
.card-link{color:var(--brand);font-weight:700;font-size:.875rem}
.grid{display:grid;gap:1rem}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:1000px){.grid-3,.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}}
.split{display:grid;grid-template-columns:1.2fr .8fr;gap:1rem}
@media(max-width:900px){.split{grid-template-columns:1fr}}

/* Buttons */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.45rem;
  min-height:42px;padding:.55rem 1.15rem;border-radius:var(--radius-pill);
  border:1px solid transparent;font-weight:700;font-size:.9rem;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;background:none;color:inherit;white-space:nowrap;
}
.btn:hover{transform:translateY(-1px)}
.btn-primary{background:var(--brand);color:#fff;box-shadow:0 8px 20px rgba(224,2,77,.22)}
.btn-grad{background:var(--grad-btn);color:#fff;box-shadow:0 8px 20px rgba(224,2,77,.2)}
.btn-ghost{border-color:var(--line);background:var(--surface);color:var(--brand)}
.btn-outline{border-color:var(--line);background:var(--surface);color:var(--ink-2)}
.btn-sm{min-height:34px;padding:.3rem .85rem;font-size:.8rem}
.btn-block{width:100%}

/* Chips / badges / tabs */
.badge{
  display:inline-flex;align-items:center;gap:.3rem;padding:.2rem .65rem;border-radius:var(--radius-pill);
  font-size:.72rem;font-weight:700;border:1px solid var(--line);background:var(--line-2);color:var(--muted);
}
.badge.pink{background:var(--brand-soft);color:var(--brand);border-color:rgba(224,2,77,.2)}
.badge.blue{background:#eff6ff;color:var(--blue);border-color:#bfdbfe}
.badge.green{background:var(--ok-soft);color:var(--ok);border-color:#bbf7d0}
.badge.violet{background:#f5f3ff;color:var(--violet);border-color:#ddd6fe}
.tabs{
  display:inline-flex;align-items:center;gap:.25rem;padding:.3rem;border:1px solid var(--line);
  border-radius:var(--radius-pill);background:var(--surface);
}
.tab{
  border:0;background:transparent;color:var(--muted);font-weight:700;font-size:.85rem;
  padding:.45rem .95rem;border-radius:var(--radius-pill);
}
.tab.active{background:var(--brand);color:#fff}
.stats-row{display:flex;flex-wrap:wrap;gap:.65rem}
.stat-pill{
  display:inline-flex;align-items:center;gap:.45rem;padding:.55rem .9rem;
  border:1px solid var(--line);border-radius:14px;background:var(--surface);font-weight:700;font-size:.85rem;
}
.stat-pill .n{font-size:1.05rem}
.stat-pill.pink{color:var(--brand);background:var(--brand-soft);border-color:rgba(224,2,77,.15)}
.stat-pill.violet{color:var(--violet);background:#f5f3ff;border-color:#ddd6fe}
.stat-pill.blue{color:var(--blue);background:#eff6ff;border-color:#bfdbfe}

/* Forms */
.field{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1rem}
.field label{font-size:.8rem;font-weight:700;color:var(--muted)}
.field input,.field select,.field textarea,.search{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-pill);
  padding:.75rem 1rem;color:var(--ink);outline:none;width:100%;
}
.field textarea{border-radius:var(--radius)}
.field input:focus,.field select:focus,.field textarea:focus,.search:focus{
  border-color:rgba(224,2,77,.45);box-shadow:0 0 0 3px rgba(224,2,77,.1);
}
.search-wrap{position:relative;margin:1rem 0}
.search-wrap svg{position:absolute;left:1rem;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--muted-2)}
.search-wrap .search{padding-left:2.6rem}

/* Content cards (oportunidad / reto / curso) */
.item-card{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:1rem 1.05rem;display:flex;flex-direction:column;gap:.65rem;min-height:180px;
  box-shadow:var(--shadow-sm);transition:transform .15s ease,box-shadow .15s ease;
}
.item-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.item-card .item-top{display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem}
.item-card h3{font-size:1rem;font-weight:800}
.item-card .desc{color:var(--muted);font-size:.875rem;flex:1}
.item-card .item-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:auto}
.score{font-weight:800;font-size:1.35rem;color:var(--brand)}
.empty{
  padding:2.25rem 1.25rem;text-align:center;color:var(--muted);
  border:1px dashed var(--line);border-radius:var(--radius-lg);background:var(--surface);
}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:.75rem .55rem;border-bottom:1px solid var(--line);text-align:left;font-size:.9rem;vertical-align:top}
.table th{color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.06em}
.row{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center}
.stack{display:flex;flex-direction:column;gap:.75rem}
.mt1{margin-top:.5rem}.mt2{margin-top:1rem}.mt3{margin-top:1.5rem}
.mb1{margin-bottom:.5rem}.mb2{margin-bottom:1rem}
.hero-card{
  background:linear-gradient(135deg,#fff 0%,#fff0f5 45%,#eef2ff 100%);
  border:1px solid var(--line);border-radius:var(--radius-lg);padding:1.35rem 1.4rem;
}
.list .list-row{
  display:flex;justify-content:space-between;gap:1rem;padding:.75rem 0;border-bottom:1px solid var(--line-2);
}
.list .list-row:last-child{border-bottom:0}
.kicker{display:inline-block;font-size:.7rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--brand);margin-bottom:.35rem}
.flash{background:#ecfdf5;border:1px solid #bbf7d0;color:#166534;padding:.65rem 1rem;border-radius:12px;margin-bottom:1rem;font-weight:600}

/* Auth / public */
.auth-page{min-height:100vh;background:var(--bg)}
.auth-top{
  display:flex;align-items:center;justify-content:space-between;padding:1rem 1.5rem;
  background:rgba(255,255,255,.9);border-bottom:1px solid var(--line);backdrop-filter:blur(8px);
}
.auth-top img{height:36px;width:auto}
.auth-wrap{display:grid;place-items:center;padding:2.5rem 1rem}
.auth-card{
  width:min(440px,100%);background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius-lg);padding:1.75rem;box-shadow:var(--shadow);
}
.landing-hero{
  max-width:960px;margin:0 auto;padding:3rem 1.25rem 4rem;display:grid;gap:1.5rem;
}
.landing-hero h1{font-size:clamp(2rem,4vw,3rem);font-weight:800}
.user-chip{font-size:.8rem;color:var(--muted)}
.logout-btn{border:0;background:transparent;color:var(--muted);font-size:.75rem;text-decoration:underline;padding:0}
