:root{
  --brand:#5b2ea6;
  --brand2:#2d7bdc;
  --bg:#0b0b10;
  --surface:#12121a;
  --text:#eaeaf2;
  --muted:#a7a7b8;
  --border:rgba(255,255,255,.10);
  --radius:16px;
  --shadow:0 18px 40px rgba(0,0,0,.35);
  --maxw:980px;
}

html,body{height:100%;}
body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(91,46,166,.25), transparent 60%),
    radial-gradient(1000px 500px at 80% 0%, rgba(45,123,220,.18), transparent 60%),
    var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{color:var(--brand2); text-decoration:none;}
a:hover{text-decoration:underline;}

.page{
  max-width:var(--maxw);
  margin:0 auto;
  padding:48px 16px;
}

.topbar{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.spacer{flex:1;}

.card{
  background:rgba(18,18,26,.92);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.header{
  padding:28px 28px 12px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.title{
  margin:0;
  font-size:28px;
  line-height:1.2;
  letter-spacing:.2px;
}
.subtitle{
  margin:10px 0 0;
  color:var(--muted);
  font-size:14px;
}

.content{ padding:22px 28px 28px; }

.stack{display:flex; flex-direction:column; gap:12px;}

.field-label{
  display:block;
  margin:0 0 8px;
  color:rgba(234,234,242,.85);
  font-size:13px;
  font-weight:600;
}

.alert{
  margin:0 0 14px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,80,80,.35);
  background:rgba(255,80,80,.10);
  color:var(--text);
  font-size:14px;
}

.help{
  margin-top:18px;
  padding:16px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
  border-radius:14px;
}
.help b{display:block; margin-bottom:10px;}
.help ul{margin:0; padding-left:18px; color:var(--muted);}
.help li{margin:6px 0;}

/* Pure form skin */
.pure-form input[type="text"],
.pure-form input[type="password"],
.pure-form input[type="email"],
.pure-form textarea,
.pure-form select{
  width:100%;
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 14px;
  color:var(--text);
  box-shadow:none;
  margin:0;
}
.pure-form input::placeholder,
.pure-form textarea::placeholder{color:rgba(234,234,242,.55);}
.pure-form input:focus,
.pure-form textarea:focus,
.pure-form select:focus{
  outline:none;
  border-color:rgba(91,46,166,.70);
  box-shadow:0 0 0 4px rgba(91,46,166,.20);
}

.pure-button.pure-button-primary{
  border-radius:12px;
  padding:12px 14px;
  font-weight:700;
  background:linear-gradient(90deg, var(--brand), var(--brand2));
  border:0;
}

/* util */
.center-col{ margin:0 auto; }

@media (max-width: 480px){
  .header{padding:22px 18px 12px;}
  .content{padding:18px;}
  .title{font-size:22px;}
}


/* ===== NAV BAR PORTAL ===== */

.portal-nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 18px;
  background:linear-gradient(
    180deg,
    rgba(255,255,255,.04),
    rgba(255,255,255,.01)
  );
  border-bottom:1px solid rgba(255,255,255,.08);
}

.nav-left{
  display:flex;
  align-items:center;
  gap:12px;
}

.avatar-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
}

.avatar{
  width:52px;
  height:52px;
  border-radius:14px;
  object-fit:cover;
  border:2px solid rgba(255,255,255,.18);
  box-shadow:0 6px 18px rgba(0,0,0,.35);
}

/* acciones */
.nav-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.nav-btn{
  padding:10px 14px;
  border-radius:12px;
  font-weight:600;
  font-size:14px;
  color:var(--text);
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  transition:all .2s ease;
}

.nav-btn:hover{
  background:rgba(255,255,255,.12);
  text-decoration:none;
  transform:translateY(-1px);
}

/* botón principal */
.nav-btn.active{
  background:linear-gradient(90deg, var(--brand), var(--brand2));
  border:0;
}

/* logout */
.nav-danger{
  background:rgba(255,80,80,.12);
  border:1px solid rgba(255,80,80,.35);
}

.nav-danger:hover{
  background:rgba(255,80,80,.22);
}

/* responsive */
@media (max-width: 640px){
  .portal-nav{
    flex-direction:column;
    align-items:flex-start;
  }
  .nav-actions{
    width:100%;
  }
  .nav-btn{
    flex:1;
    text-align:center;
  }
}

/* grid spacing */
.media-grid{ margin-top: 14px; }
.media-grid .pure-u-1-2,
.media-grid .pure-u-md-1-3,
.media-grid .pure-u-lg-1-4{ box-sizing: border-box; }

.media-card{
  display:block;
  text-decoration:none;
  color:var(--text);
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 10px 28px rgba(0,0,0,.25);
  transition:transform .15s ease, background .15s ease;
}
.media-card:hover{
  transform: translateY(-2px);
  background:rgba(255,255,255,.05);
  text-decoration:none;
}

/* este div “fija” el tamaño y evita que se salgan */
.media-thumb{
  width:100%;
  aspect-ratio: 4 / 3;   /* puedes cambiar a 1/1 o 3/4 */
  background:rgba(0,0,0,.25);
}
.media-thumb img{
  width:100%;
  height:100%;
  display:block;
  object-fit: cover;     /* recorta pero se ve uniforme */
  object-position:center;
}

.media-meta{
  padding:12px 12px 14px;
}
.media-title{
  font-weight:700;
  font-size:14px;
  line-height:1.2;
}
.media-sub{
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
}

/* ===== TABLAS PORTAL ===== */
.table-wrap{
  width:100%;
  overflow:auto;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.02);
}

.portal-table{
  width:100%;
  border-collapse:collapse;
}

.portal-table thead th{
  position:sticky;
  top:0;
  background:rgba(18,18,26,.92);
  color:rgba(234,234,242,.92);
  border-bottom:1px solid rgba(255,255,255,.08);
  font-weight:700;
  font-size:13px;
  white-space:nowrap;
}

.portal-table td{
  color:rgba(234,234,242,.90);
  border-bottom:1px solid rgba(255,255,255,.06);
  font-size:13px;
  white-space:nowrap;
}

.portal-table tr:hover td{
  background:rgba(255,255,255,.03);
}

.muted{ color: var(--muted); }
