:root{
  --bg:#0b0e14;
  --panel:#101725;
  --panel2:#0f1522;
  --card:#131c2e;
  --text:#e9eefc;
  --muted:#a9b3c9;
  --line:#22304b;
  --accent:#4da3ff;
  --ok:#49d17d;
  --mark:#ffe46a;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --radius2: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: var(--font);
  background: radial-gradient(1200px 800px at 15% 0%, #142142 0%, var(--bg) 55%);
  color: var(--text);
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(11,14,20,.7);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:42px; height:42px;
  display:grid; place-items:center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8a6bff);
  box-shadow: var(--shadow);
  font-weight:900;
}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-subtitle{font-size:.85rem; color: var(--muted)}

.topbar-actions{display:flex; align-items:center; gap:10px; flex-wrap: wrap;}
.search-wrap{display:flex; gap:8px; align-items:center}
input[type="search"]{
  width: min(520px, 56vw);
  padding: 12px 14px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(16,23,37,.55);
  color: var(--text);
  outline:none;
}
input[type="search"]::placeholder{color: #7f8bb0}
input[type="search"]:focus{border-color: rgba(77,163,255,.8)}

.btn{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(19,28,46,.7);
  color: var(--text);
  cursor:pointer;
  transition: transform .06s ease, border-color .2s ease, background .2s ease;
}
.btn:hover{border-color: rgba(77,163,255,.6)}
.btn:active{transform: translateY(1px)}
.btn.ghost{background: transparent}

.user-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(19,28,46,.35);
  cursor:pointer;
}
.user-chip .dot{
  width:10px;height:10px;border-radius:50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(73,209,125,.12);
}

.layout{
  display:grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 70px);
}

.sidebar{
  border-right: 1px solid var(--line);
  padding: 16px;
  background: rgba(16,23,37,.35);
}

.nav{display:flex; flex-direction:column; gap:10px}
.nav button{
  width:100%;
  text-align:left;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding: 12px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(19,28,46,.35);
  color: var(--text);
  cursor:pointer;
}
.nav button.active{
  border-color: rgba(77,163,255,.7);
  background: rgba(77,163,255,.12);
}
.nav .badge{
  font-size:.78rem;
  color: var(--muted);
  background: rgba(27,39,64,.8);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.sidebar-foot{
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.hint{color: var(--muted); font-size:.9rem}
.hint ul{margin:8px 0 0 18px}

.main{padding: 18px}
.panel{
  background: rgba(16,23,37,.45);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-head h1{margin: 0 0 6px 0}
.muted{color: var(--muted); margin: 0}

.panel-toolbar{
  margin-top: 14px;
  display:flex;
  gap:10px;
  align-items:center;
}

.results-meta{
  margin-top: 10px;
  color: var(--muted);
  font-size:.92rem;
}

.cards{
  margin-top: 14px;
  display:grid;
  gap: 12px;
}

.card{
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(19,28,46,.45);
  overflow:hidden;
}
.card-head{
  padding: 14px 14px 10px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.card-title{
  font-weight: 800;
  line-height:1.25;
}
.chips{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.chip{
  background: rgba(27,39,64,.9);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  font-size:.78rem;
  color: var(--muted);
}

.card-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.small{padding: 8px 10px; border-radius: 12px; font-size:.9rem}

.card-body{
  padding: 0 14px 14px;
  display:none;
}
.card.active .card-body{display:block}

.content{
  margin-top: 8px;
  line-height:1.5;
  color: #d8e1ff;
  white-space: pre-wrap;
}

.mark{
  background: var(--mark);
  color: #1a1a1a;
  padding: 0 3px;
  border-radius: 6px;
}

.resources{
  margin-top: 12px;
  display:grid;
  gap: 8px;
}
.res-item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15,21,34,.6);
}
.res-left{display:flex; flex-direction:column; gap:2px}
.res-title{font-weight:700}
.res-meta{font-size:.85rem; color: var(--muted)}
.res-actions{display:flex; gap:8px; flex-wrap:wrap}

.modal{
  width: min(900px, 92vw);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(16,23,37,.96);
  color: var(--text);
  box-shadow: var(--shadow);
}
.modal::backdrop{background: rgba(0,0,0,.6)}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-title{font-weight:800}
.modal-body{padding: 14px}
.modal-body img{max-width:100%; border-radius: 16px; border: 1px solid var(--line)}
.modal-body video{width:100%; max-width: 400px; border-radius: 16px; border: 1px solid var(--line)}

.name-input{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(16,23,37,.55);
  color: var(--text);
  outline:none;
}
.name-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:12px;
}


/* PANEL IZQUIERDO */
.sidebar {
  width: 260px;
  background: rgba(16,23,37,.55);
  padding: 20px;
}

/* CONTENIDO */
.content {
  flex: 1;
  padding: 20px;
}

/* BOTÓN MENÚ (oculto en desktop) */
.menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1100;
  background: #333;
  color: #fff;
  border: none;
  padding: 12px 16px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
}

/* 📱 MODO MÓVIL */
@media (max-width: 768px) {

  .layout {
    display: block;
  }

  .menu-toggle {
    display: block;
  }

  .overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
}

.topbar{
  padding-top: 75px;
}

/* cuando el panel está abierto */
.overlay.active {
  display: block;
}

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: rgb(16, 23, 37);
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    padding-top: 85px;
  }

  .sidebar.open {
    left: 0;
  }

  .content {
    padding: 20px;
  }
}
